Skip to content

Commit

Permalink
The LOG initialization code would clear the last error. Use PLOG inst…
Browse files Browse the repository at this point in the history
…ead.

LOG(...) needs to perform log initialization when called for the first time. It may call Windows APIs that clears the last error in which case the message written to the log will contain the wrong last error code. PLOG does the right thing by getting the last error code before initialing the log file.

BUG=

Review URL: https://codereview.chromium.org/331883009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@280103 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
weitaosu@chromium.org committed Jun 26, 2014
1 parent 6d885c6 commit 8398bf1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ipc/ipc_channel_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,8 @@ bool ChannelWin::CreatePipe(const IPC::ChannelHandle &channel_handle,

if (pipe_ == INVALID_HANDLE_VALUE) {
// If this process is being closed, the pipe may be gone already.
LOG(WARNING) << "Unable to create pipe \"" << pipe_name <<
"\" in " << (mode & MODE_SERVER_FLAG ? "server" : "client")
<< " mode. Error :" << GetLastError();
PLOG(WARNING) << "Unable to create pipe \"" << pipe_name << "\" in "
<< (mode & MODE_SERVER_FLAG ? "server" : "client") << " mode";
return false;
}

Expand Down

0 comments on commit 8398bf1

Please sign in to comment.