Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: sandbox/linux/suid/linux_util.c

Issue 266913019: Ensure that _GNU_SOURCE is defined early enough (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add a better comment Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sandbox/linux/suid/process_util_linux.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // The following is duplicated from base/linux_utils.cc. 5 // The following is duplicated from base/linux_utils.cc.
6 // We shouldn't link against C++ code in a setuid binary. 6 // We shouldn't link against C++ code in a setuid binary.
7 7
8 // Needed for O_DIRECTORY, must be defined before fcntl.h is included
9 // (and it can be included earlier than the explicit #include below
10 // in some versions of glibc).
11 #define _GNU_SOURCE
12
8 #include "sandbox/linux/suid/linux_util.h" 13 #include "sandbox/linux/suid/linux_util.h"
9 14
10 #define _GNU_SOURCE // For O_DIRECTORY
11
12 #include <dirent.h> 15 #include <dirent.h>
13 #include <errno.h> 16 #include <errno.h>
14 #include <fcntl.h> 17 #include <fcntl.h>
15 #include <limits.h> 18 #include <limits.h>
16 #include <stdio.h> 19 #include <stdio.h>
17 #include <stdlib.h> 20 #include <stdlib.h>
18 #include <string.h> 21 #include <string.h>
19 #include <sys/stat.h> 22 #include <sys/stat.h>
20 #include <sys/types.h> 23 #include <sys/types.h>
21 #include <unistd.h> 24 #include <unistd.h>
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 } 131 }
129 } 132 }
130 } 133 }
131 closedir(fd); 134 closedir(fd);
132 close(proc_pid_fd); 135 close(proc_pid_fd);
133 } 136 }
134 closedir(proc); 137 closedir(proc);
135 138
136 return already_found; 139 return already_found;
137 } 140 }
OLDNEW
« no previous file with comments | « no previous file | sandbox/linux/suid/process_util_linux.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698