about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2012-03-20 01:41:20 +0000
committerEric Wong <normalperson@yhbt.net>2012-03-19 18:41:08 -0700
commitc454730febd2ad584ef7c2f4b0459af5cc71c551 (patch)
tree1b625f2871cb4bb85bc75b81b8e1bec3dee11a2d
parent2c39d7e86ce9c1ba561ca524699396730e8e212e (diff)
downloadcmogstored-c454730febd2ad584ef7c2f4b0459af5cc71c551.tar.gz
_GNU_SOURCE will define _ATFILE_SOURCE on older CentOS machines
This change is also tested on FreeBSD 9.0 and does not break
existing dirent.h usage in svc.c
-rw-r--r--cmogstored.h4
-rw-r--r--svc.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/cmogstored.h b/cmogstored.h
index b9bc9b3..5e5b3e8 100644
--- a/cmogstored.h
+++ b/cmogstored.h
@@ -9,8 +9,12 @@
  */
 #include "config.h"
 #include "queue_kqueue.h"
+#ifndef _XOPEN_SOURCE
 #define _XOPEN_SOURCE 700
+#endif
+#ifndef _POSIX_C_SOURCE
 #define  _POSIX_C_SOURCE 200809L
+#endif
 #include <pthread.h>
 #include <sys/uio.h>
 #include <sys/mman.h>
diff --git a/svc.c b/svc.c
index 8f13657..0ed1341 100644
--- a/svc.c
+++ b/svc.c
@@ -2,6 +2,8 @@
  * Copyright (C) 2012, Eric Wong <normalperson@yhbt.net>
  * License: GPLv3 or later (see COPYING for details)
  */
+
+#define _GNU_SOURCE 1 /* needed for _ATFILE_SOURCE on glibc 2.5 - 2.9 */
 #include <dirent.h> /* needed for FreeBSD */
 #include "cmogstored.h"