diff options
author | tschmelcher@chromium.org <tschmelcher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-13 18:27:40 +0000 |
---|---|---|
committer | tschmelcher@chromium.org <tschmelcher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-13 18:27:40 +0000 |
commit | 57b765671983005059e8be4523872796b9505428 (patch) | |
tree | c84b82b586cae2b39ef784f1ee1d58c1431bb140 /net/proxy/proxy_config_service_linux.cc | |
parent | fd8d08436730ef67591de7665da88e995159b773 (diff) | |
download | chromium_src-57b765671983005059e8be4523872796b9505428.zip chromium_src-57b765671983005059e8be4523872796b9505428.tar.gz chromium_src-57b765671983005059e8be4523872796b9505428.tar.bz2 |
Eliminate all uses of strerror() in code that uses src/base. strerror() is inherently unsafe in multi-threaded apps because it stores the string in a global buffer. It should never be used. If you want to log an error, use PLOG and friends, or if that's too high-level then use safe_strerror().
TEST=built on Linux in 32-bit and 64-bit mode; ran base_unittests in each case; ran Chromium itself in each case; try servers
BUG=none
Review URL: http://codereview.chromium.org/261055
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28850 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy/proxy_config_service_linux.cc')
-rw-r--r-- | net/proxy/proxy_config_service_linux.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/proxy/proxy_config_service_linux.cc b/net/proxy/proxy_config_service_linux.cc index a507771..3ca35c5 100644 --- a/net/proxy/proxy_config_service_linux.cc +++ b/net/proxy/proxy_config_service_linux.cc @@ -439,12 +439,12 @@ class GConfSettingGetterImplKDE DCHECK(inotify_fd_ < 0); inotify_fd_ = inotify_init(); if (inotify_fd_ < 0) { - LOG(ERROR) << "inotify_init failed: " << strerror(errno); + PLOG(ERROR) << "inotify_init failed"; return false; } int flags = fcntl(inotify_fd_, F_GETFL); if (fcntl(inotify_fd_, F_SETFL, flags | O_NONBLOCK) < 0) { - LOG(ERROR) << "fcntl failed: " << strerror(errno); + PLOG(ERROR) << "fcntl failed"; close(inotify_fd_); inotify_fd_ = -1; return false; @@ -763,8 +763,7 @@ class GConfSettingGetterImplKDE // new behavior (EINVAL) so we can reuse the code below. errno = EINVAL; if (errno != EAGAIN) { - LOG(WARNING) << "error reading inotify file descriptor: " - << strerror(errno); + PLOG(WARNING) << "error reading inotify file descriptor"; if (errno == EINVAL) { // Our buffer is not large enough to read the next event. This should // not happen (because its size is calculated to always be sufficiently |