Index: sandbox/linux/suid/linux_util.c |
diff --git a/sandbox/linux/suid/linux_util.c b/sandbox/linux/suid/linux_util.c |
index 320f6ca37429fd4fe5ba9429ad547354a16047ed..9febe6d9cf2c62369154f13c2b7614d709540379 100644 |
--- a/sandbox/linux/suid/linux_util.c |
+++ b/sandbox/linux/suid/linux_util.c |
@@ -5,9 +5,12 @@ |
// The following is duplicated from base/linux_utils.cc. |
// We shouldn't link against C++ code in a setuid binary. |
-#include "sandbox/linux/suid/linux_util.h" |
+// Needed for O_DIRECTORY, must be defined before fcntl.h is included |
+// (and it can be included earlier than the explicit #include below |
+// in some versions of glibc). |
+#define _GNU_SOURCE |
-#define _GNU_SOURCE // For O_DIRECTORY |
+#include "sandbox/linux/suid/linux_util.h" |
#include <dirent.h> |
#include <errno.h> |