summaryrefslogtreecommitdiffstats
path: root/runtime/stream.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-09-14 15:39:37 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-09-14 15:39:37 +0200
commit78469b4c6a82887c70e2cac365af7a66051f8ba7 (patch)
tree8fe63d66432a9bf24ce80d4ce99a21b1024d883b /runtime/stream.c
parentbfac3c68f47b8769b0936fb80eeea8880793fd2d (diff)
parent92b4f6d610a3b4de9066d4f26a712cf6b1507250 (diff)
downloadrsyslog-78469b4c6a82887c70e2cac365af7a66051f8ba7.tar.gz
rsyslog-78469b4c6a82887c70e2cac365af7a66051f8ba7.tar.bz2
rsyslog-78469b4c6a82887c70e2cac365af7a66051f8ba7.zip
Merge branch 'v4-beta' into v4-devel
Diffstat (limited to 'runtime/stream.c')
-rw-r--r--runtime/stream.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/runtime/stream.c b/runtime/stream.c
index 605a9771..8098f778 100644
--- a/runtime/stream.c
+++ b/runtime/stream.c
@@ -961,6 +961,12 @@ finalize_it:
* is worth (read: data loss may occur where we otherwise might not
* have it). -- rgerhards, 2009-06-08
*/
+#undef SYNCCALL
+#if HAVE_FDATASYNC
+# define SYNCCALL(x) fdatasync(x)
+#else
+# define SYNCCALL(x) fsync(x)
+#endif
static rsRetVal
syncFile(strm_t *pThis)
{
@@ -971,7 +977,7 @@ syncFile(strm_t *pThis)
FINALIZE; /* TTYs can not be synced */
DBGPRINTF("syncing file %d\n", pThis->fd);
- ret = fdatasync(pThis->fd);
+ ret = SYNCCALL(pThis->fd);
if(ret != 0) {
char errStr[1024];
int err = errno;
@@ -987,7 +993,7 @@ syncFile(strm_t *pThis)
finalize_it:
RETiRet;
}
-
+#undef SYNCCALL
/* physically write to the output file. the provided data is ready for
* writing (e.g. zipped if we are requested to do that).