summaryrefslogtreecommitdiffstats
path: root/tools/omfile.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-03-05 12:53:15 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2010-03-05 12:53:15 +0100
commit34d1694e9d74c545995e86320befae5d6c5a9021 (patch)
tree9c629ca2c5221297485d53074258a01f25588bd5 /tools/omfile.c
parent40be6cb6e7a167402039d24e047c94bdb19bd22e (diff)
downloadrsyslog-34d1694e9d74c545995e86320befae5d6c5a9021.tar.gz
rsyslog-34d1694e9d74c545995e86320befae5d6c5a9021.tar.xz
rsyslog-34d1694e9d74c545995e86320befae5d6c5a9021.zip
bugfix: omfile.c did not properly compile without atomics
while this worked on another platform, it did not work here, and failed to do so for good reasons ;)
Diffstat (limited to 'tools/omfile.c')
-rw-r--r--tools/omfile.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/omfile.c b/tools/omfile.c
index 9562e9cf..6c90243d 100644
--- a/tools/omfile.c
+++ b/tools/omfile.c
@@ -48,10 +48,13 @@
#include <libgen.h>
#include <unistd.h>
#include <sys/file.h>
-
#ifdef OS_SOLARIS
# include <fcntl.h>
#endif
+#ifdef HAVE_ATOMIC_BUILTINS
+# include <pthread.h>
+#endif
+
#include "conf.h"
#include "syslogd-types.h"
@@ -108,9 +111,11 @@ getClockFileAccess(void)
{
uint64 retVal;
+ BEGINfunc
d_pthread_mutex_lock(&mutClock);
retVal = ++clockFileAccess;
d_pthread_mutex_unlock(&mutClock);
+ ENDfunc
return retVal;
}
#endif /* #ifdef HAVE_ATOMIC_BUILTINS */