From 57b765671983005059e8be4523872796b9505428 Mon Sep 17 00:00:00 2001 From: "tschmelcher@chromium.org" Date: Tue, 13 Oct 2009 18:27:40 +0000 Subject: 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 --- base/directory_watcher_inotify.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'base/directory_watcher_inotify.cc') diff --git a/base/directory_watcher_inotify.cc b/base/directory_watcher_inotify.cc index 44e4dcb..d171a7a 100644 --- a/base/directory_watcher_inotify.cc +++ b/base/directory_watcher_inotify.cc @@ -209,7 +209,7 @@ class InotifyReaderTask : public Task { HANDLE_EINTR(select(std::max(inotify_fd_, shutdown_fd_) + 1, &rfds, NULL, NULL, NULL)); if (select_result < 0) { - DLOG(WARNING) << "select failed: " << strerror(errno); + DPLOG(WARNING) << "select failed"; return; } @@ -222,7 +222,7 @@ class InotifyReaderTask : public Task { &buffer_size)); if (ioctl_result != 0) { - DLOG(WARNING) << "ioctl failed: " << strerror(errno); + DPLOG(WARNING) << "ioctl failed"; return; } @@ -232,7 +232,7 @@ class InotifyReaderTask : public Task { buffer_size)); if (bytes_read < 0) { - DLOG(WARNING) << "read from inotify fd failed: " << strerror(errno); + DPLOG(WARNING) << "read from inotify fd failed"; return; } -- cgit v1.1