summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-03-23 12:38:44 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2010-03-23 12:38:44 +0100
commitc1e3a032b447487ced9873b98a015046778d2b04 (patch)
tree93dfe26b1843674aa86a5e1d86493a6a6406675d
parenta61e164a977ff17b90f9a301dacbc5a01aca7e7e (diff)
parenta6df6a1740956b72acb7cbf9d17a51635ea18dfc (diff)
downloadrsyslog-c1e3a032b447487ced9873b98a015046778d2b04.tar.gz
rsyslog-c1e3a032b447487ced9873b98a015046778d2b04.tar.xz
rsyslog-c1e3a032b447487ced9873b98a015046778d2b04.zip
Merge branch 'master-solaris'
-rw-r--r--runtime/atomic.h3
-rw-r--r--tools/omfile.c7
2 files changed, 9 insertions, 1 deletions
diff --git a/runtime/atomic.h b/runtime/atomic.h
index 51b14e18..f1152daf 100644
--- a/runtime/atomic.h
+++ b/runtime/atomic.h
@@ -183,6 +183,9 @@ void atomicSemExit(void);
# define ATOMIC_DEC_AND_FETCH(data) (--(data))
# define ATOMIC_FETCH_32BIT(data) (data)
# define ATOMIC_STORE_1_TO_32BIT(data) (data) = 1
+# define ATOMIC_STORE_1_TO_INT(data) (data) = 1
+# define ATOMIC_STORE_0_TO_INT(data) (data) = 0
+# define ATOMIC_CAS_VAL(data, oldVal, newVal) (data) = (newVal)
#endif
#endif
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 */