diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-25 22:58:47 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-25 22:58:47 +0000 |
commit | b3f0f4bf66f96b3b380d62349cf2e61d7ab95ecb (patch) | |
tree | 976518e97112722be0a5d09a994a5faaac1fb317 /sandbox/linux/suid | |
parent | 95250e4c742d27fad6e4bb737a8110a4ee63323c (diff) | |
download | chromium_src-b3f0f4bf66f96b3b380d62349cf2e61d7ab95ecb.zip chromium_src-b3f0f4bf66f96b3b380d62349cf2e61d7ab95ecb.tar.gz chromium_src-b3f0f4bf66f96b3b380d62349cf2e61d7ab95ecb.tar.bz2 |
Revert "linux: turn on -Wextra"
Compiled locally and on trybots but failed on builder?!
This reverts commit r42688.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42689 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/linux/suid')
-rw-r--r-- | sandbox/linux/suid/linux_util.c | 5 | ||||
-rw-r--r-- | sandbox/linux/suid/process_util_linux.c | 2 | ||||
-rw-r--r-- | sandbox/linux/suid/sandbox.c | 23 |
3 files changed, 14 insertions, 16 deletions
diff --git a/sandbox/linux/suid/linux_util.c b/sandbox/linux/suid/linux_util.c index c5af0d0..ded545b 100644 --- a/sandbox/linux/suid/linux_util.c +++ b/sandbox/linux/suid/linux_util.c @@ -83,9 +83,8 @@ bool FindProcessHoldingSocket(pid_t* pid_out, ino_t socket_inode) { continue; while ((dent = readdir(fd))) { - int printed = snprintf(buf, sizeof(buf), "/proc/%lu/fd/%s", pid_ul, - dent->d_name); - if (printed < 0 || printed >= (int)(sizeof(buf) - 1)) { + if (snprintf(buf, sizeof(buf), "/proc/%lu/fd/%s", pid_ul, + dent->d_name) >= sizeof(buf) - 1) { continue; } diff --git a/sandbox/linux/suid/process_util_linux.c b/sandbox/linux/suid/process_util_linux.c index 7b31274..9f40f39 100644 --- a/sandbox/linux/suid/process_util_linux.c +++ b/sandbox/linux/suid/process_util_linux.c @@ -38,7 +38,7 @@ bool AdjustOOMScore(pid_t process, int score) { char buf[3]; // 0 <= |score| <= 15; snprintf(buf, sizeof(buf), "%d", score); - ssize_t len = strlen(buf); + size_t len = strlen(buf); ssize_t bytes_written = write(fd, buf, len); close(fd); diff --git a/sandbox/linux/suid/sandbox.c b/sandbox/linux/suid/sandbox.c index 7389f03..e4968c9 100644 --- a/sandbox/linux/suid/sandbox.c +++ b/sandbox/linux/suid/sandbox.c @@ -90,13 +90,13 @@ static int CloneChrootHelperProcess() { char tempDirectoryTemplate[80] = "/tmp/chrome-sandbox-chroot-XXXXXX"; struct statfs sfs; if (!statfs("/tmp", &sfs) && - (unsigned long)sfs.f_type != BTRFS_SUPER_MAGIC && - (unsigned long)sfs.f_type != EXT2_SUPER_MAGIC && - (unsigned long)sfs.f_type != EXT3_SUPER_MAGIC && - (unsigned long)sfs.f_type != EXT4_SUPER_MAGIC && - (unsigned long)sfs.f_type != REISERFS_SUPER_MAGIC && - (unsigned long)sfs.f_type != TMPFS_MAGIC && - (unsigned long)sfs.f_type != XFS_SUPER_MAGIC) { + sfs.f_type != BTRFS_SUPER_MAGIC && + sfs.f_type != EXT2_SUPER_MAGIC && + sfs.f_type != EXT3_SUPER_MAGIC && + sfs.f_type != EXT4_SUPER_MAGIC && + sfs.f_type != REISERFS_SUPER_MAGIC && + sfs.f_type != TMPFS_MAGIC && + sfs.f_type != XFS_SUPER_MAGIC) { // If /dev/shm exists, it is supposed to be a tmpfs filesystem. While we // are not actually using it for shared memory, moving our temp directory // into a known tmpfs filesystem is preferable over using a potentially @@ -137,7 +137,7 @@ static int CloneChrootHelperProcess() { char proc_self_fd_str[128]; int printed = snprintf(proc_self_fd_str, sizeof(proc_self_fd_str), "/proc/self/fd/%d", chroot_dir_fd); - if (printed < 0 || printed >= (int)sizeof(proc_self_fd_str)) { + if (printed < 0 || printed >= sizeof(proc_self_fd_str)) { fprintf(stderr, "Error in snprintf"); return -1; } @@ -246,7 +246,7 @@ static bool SpawnChrootHelper() { // number of the file descriptor. char desc_str[64]; int printed = snprintf(desc_str, sizeof(desc_str), "%d", chroot_signal_fd); - if (printed < 0 || printed >= (int)sizeof(desc_str)) { + if (printed < 0 || printed >= sizeof(desc_str)) { fprintf(stderr, "Failed to snprintf\n"); return false; } @@ -379,10 +379,9 @@ int main(int argc, char **argv) { if (argc == 4 && (0 == strcmp(argv[1], kAdjustOOMScoreSwitch))) { char* endptr; long score; - unsigned long pid_ul = strtoul(argv[2], &endptr, 10); - if (pid_ul == ULONG_MAX || *endptr) + pid_t pid = strtoul(argv[2], &endptr, 10); + if (pid == ULONG_MAX || *endptr) return 1; - pid_t pid = pid_ul; score = strtol(argv[3], &endptr, 10); if (score == LONG_MAX || score == LONG_MIN || *endptr) return 1; |