summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/graph.c2
-rw-r--r--libglusterfs/src/logging.c7
-rw-r--r--libglusterfs/src/logging.h2
3 files changed, 4 insertions, 7 deletions
diff --git a/libglusterfs/src/graph.c b/libglusterfs/src/graph.c
index d5fcafd6810..a0c4c122fe7 100644
--- a/libglusterfs/src/graph.c
+++ b/libglusterfs/src/graph.c
@@ -416,7 +416,7 @@ fill_uuid (char *uuid, int size)
localtime_r (&tv.tv_sec, &now);
strftime (now_str, 32, "%Y/%m/%d-%H:%M:%S", &now);
- snprintf (uuid, size, "%s-%d-%s:%ld",
+ snprintf (uuid, size, "%s-%d-%s:%"GF_PRI_SUSECONDS,
hostname, getpid(), now_str, tv.tv_usec);
return;
diff --git a/libglusterfs/src/logging.c b/libglusterfs/src/logging.c
index e7f61623133..d5a38e6b6b8 100644
--- a/libglusterfs/src/logging.c
+++ b/libglusterfs/src/logging.c
@@ -216,12 +216,7 @@ log:
strftime (timestr, 256, "%Y-%m-%d %H:%M:%S", tm);
snprintf (timestr + strlen (timestr), 256 - strlen (timestr),
-#ifdef GF_DARWIN_HOST_OS
- ".%"PRId32,
-#else
- ".%ld",
-#endif
- tv.tv_usec);
+ ".%"GF_PRI_SUSECONDS, tv.tv_usec);
basename = strrchr (file, '/');
if (basename)
diff --git a/libglusterfs/src/logging.h b/libglusterfs/src/logging.h
index 8c78a3ee1d6..fdb24dab9f6 100644
--- a/libglusterfs/src/logging.h
+++ b/libglusterfs/src/logging.h
@@ -34,10 +34,12 @@
#define GF_PRI_FSBLK "u"
#define GF_PRI_DEV PRId32
#define GF_PRI_NLINK PRIu16
+#define GF_PRI_SUSECONDS PRId32
#else
#define GF_PRI_FSBLK PRIu64
#define GF_PRI_DEV PRIu64
#define GF_PRI_NLINK PRIu32
+#define GF_PRI_SUSECONDS "ld"
#endif
#define GF_PRI_BLKSIZE PRId32
#define GF_PRI_SIZET "zu"