#endif
#include "vm_assert.h"
+#include "vm_atomic.h"
typedef struct FileLoggerData {
LogHandlerData handler;
if (g_file_test(path, G_FILE_TEST_EXISTS)) {
struct stat fstats;
if (g_stat(path, &fstats) > -1) {
+#if GLIB_CHECK_VERSION(2, 10, 0)
g_atomic_int_set(&data->logSize, (gint) fstats.st_size);
+#else
+ data->logSize = (gint) fstats.st_size;
+ Atomic_MFence();
+#endif
}
if (!data->append || g_atomic_int_get(&data->logSize) >= data->maxSize) {
g_free(g_ptr_array_index(logfiles, id));
}
g_ptr_array_free(logfiles, TRUE);
+#if GLIB_CHECK_VERSION(2, 10, 0)
g_atomic_int_set(&data->logSize, 0);
+#else
+ data->logSize = 0;
+ Atomic_MFence();
+#endif
data->append = FALSE;
}
}
#endif
context = g_option_context_new(NULL);
-#if GLIB_MAJOR_VERSION >= 2 && GLIB_MINOR_VERSION >= 12
+#if GLIB_CHECK_VERSION(2, 12, 0)
g_option_context_set_summary(context, N_("Runs the VMware Tools daemon."));
#endif
g_option_context_add_main_entries(context, clOptions, NULL);