From 012a67451afc724a41e26bd7998aa8523d294959 Mon Sep 17 00:00:00 2001 From: "craig.schlenter@chromium.org" Date: Wed, 10 Mar 2010 15:18:51 +0000 Subject: Make sandbox code compile as "chromium_code". MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This sets up useful flags like -Wall -Werror etc. Also squash a compiler warning: sandbox/linux/suid/process_util_linux.c: In function ‘AdjustOOMScore’: sandbox/linux/suid/process_util_linux.c:25: error: format ‘%lu’ expects type ‘long unsigned int’, but argument 4 has type ‘pid_t’ BUG=none TEST=try-servers Review URL: http://codereview.chromium.org/733001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41161 0039d316-1c4b-4281-b951-d872f2087c98 --- sandbox/linux/suid/process_util_linux.c | 5 +++-- sandbox/sandbox.gyp | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sandbox/linux/suid/process_util_linux.c b/sandbox/linux/suid/process_util_linux.c index 4a574ad..9f40f39 100644 --- a/sandbox/linux/suid/process_util_linux.c +++ b/sandbox/linux/suid/process_util_linux.c @@ -8,6 +8,7 @@ #include "process_util.h" #include +#include #include #include #include @@ -20,9 +21,9 @@ bool AdjustOOMScore(pid_t process, int score) { if (score < 0 || score > 15) return false; - char oom_adj[35]; // "/proc/" + log_2(2**64) + "/oom_adj\0" + char oom_adj[35]; // "/proc/" + log_10(2**64) + "/oom_adj\0" // 6 + 20 + 9 = 35 - snprintf(oom_adj, sizeof(oom_adj), "/proc/%lu", process); + snprintf(oom_adj, sizeof(oom_adj), "/proc/%" PRIdMAX, (intmax_t)process); struct stat statbuf; if (stat(oom_adj, &statbuf) < 0) diff --git a/sandbox/sandbox.gyp b/sandbox/sandbox.gyp index 87f4f33..50094f9 100644 --- a/sandbox/sandbox.gyp +++ b/sandbox/sandbox.gyp @@ -3,6 +3,9 @@ # found in the LICENSE file. { + 'variables': { + 'chromium_code': 1, + }, 'target_defaults': { 'variables': { 'sandbox_windows_target': 0, -- cgit v1.1