diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-13 23:20:04 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-13 23:20:04 +0000 |
commit | 46e9acad2bf6624ccb9d9eddc339bba6104e3c68 (patch) | |
tree | 299a27cf65c39394e56b824b42ded62a2fd20bd0 /base | |
parent | 68ac0e6648be0d419ccd2359c97af48079dc7500 (diff) | |
download | chromium_src-46e9acad2bf6624ccb9d9eddc339bba6104e3c68.zip chromium_src-46e9acad2bf6624ccb9d9eddc339bba6104e3c68.tar.gz chromium_src-46e9acad2bf6624ccb9d9eddc339bba6104e3c68.tar.bz2 |
Cleanup: Move some const char definitions to the .cc file. (try 2)
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10535141
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142013 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/linux_util.cc | 15 | ||||
-rw-r--r-- | base/linux_util.h | 8 |
2 files changed, 15 insertions, 8 deletions
diff --git a/base/linux_util.cc b/base/linux_util.cc index 0a9ef56..44ce12f 100644 --- a/base/linux_util.cc +++ b/base/linux_util.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -103,7 +103,7 @@ bool ProcPathGetInode(ino_t* inode_out, const char* path, bool log = false) { return false; } - char *endptr; + char* endptr; const unsigned long long int inode_ul = strtoull(buf + sizeof(kSocketLinkPrefix) - 1, &endptr, 10); if (*endptr != ']') @@ -125,6 +125,13 @@ bool ProcPathGetInode(ino_t* inode_out, const char* path, bool log = false) { namespace base { +const char kFindInodeSwitch[] = "--find-inode"; + +// This should be kept in sync with sandbox/linux/suid/sandbox.c +const long kSUIDSandboxApiNumber = 1; +const char kSandboxEnvironmentApiRequest[] = "SBX_CHROME_API_RQ"; +const char kSandboxEnvironmentApiProvides[] = "SBX_CHROME_API_PRV"; + // Account for the terminating null character. static const int kDistroSize = 128 + 1; @@ -211,7 +218,7 @@ bool FindProcessHoldingSocket(pid_t* pid_out, ino_t socket_inode) { struct dirent* dent; while ((dent = readdir(proc))) { - char *endptr; + char* endptr; const unsigned long int pid_ul = strtoul(dent->d_name, &endptr, 10); if (pid_ul == ULONG_MAX || *endptr) continue; @@ -272,7 +279,7 @@ pid_t FindThreadIDWithSyscall(pid_t pid, const std::string& expected_data, std::vector<pid_t> tids; struct dirent* dent; while ((dent = readdir(task))) { - char *endptr; + char* endptr; const unsigned long int tid_ul = strtoul(dent->d_name, &endptr, 10); if (tid_ul == ULONG_MAX || *endptr) continue; diff --git a/base/linux_util.h b/base/linux_util.h index cd305f8..02605bc 100644 --- a/base/linux_util.h +++ b/base/linux_util.h @@ -15,12 +15,12 @@ namespace base { -static const char kFindInodeSwitch[] = "--find-inode"; +BASE_EXPORT extern const char kFindInodeSwitch[]; // This should be kept in sync with sandbox/linux/suid/sandbox.c -static const long kSUIDSandboxApiNumber = 1; -static const char kSandboxEnvironmentApiRequest[] = "SBX_CHROME_API_RQ"; -static const char kSandboxEnvironmentApiProvides[] = "SBX_CHROME_API_PRV"; +BASE_EXPORT extern const long kSUIDSandboxApiNumber; +BASE_EXPORT extern const char kSandboxEnvironmentApiRequest[]; +BASE_EXPORT extern const char kSandboxEnvironmentApiProvides[]; // This is declared here so the crash reporter can access the memory directly // in compromised context without going through the standard library. |