diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-16 23:00:15 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-16 23:00:15 +0000 |
commit | 19cb929fa737ae5ef3c1425d38a793ef8967ee00 (patch) | |
tree | 84801b2724d970541aa86f8a81d1f4b0c1d89ff6 /chrome/browser/zygote_main_linux.cc | |
parent | b3c064c2338e88a6ecfef7454bc3301d643a91fe (diff) | |
download | chromium_src-19cb929fa737ae5ef3c1425d38a793ef8967ee00.zip chromium_src-19cb929fa737ae5ef3c1425d38a793ef8967ee00.tar.gz chromium_src-19cb929fa737ae5ef3c1425d38a793ef8967ee00.tar.bz2 |
posix: handle the return value of close() in more places.
Generally, we don't expect it to fail and there isn't much we
can do anyway, but it's good to at least consider each case and
do something so we can continue to receive warnings in situations
where we forgot to check the return code.
(Bonus extra bugfix: use int where we previously had bool.
I think it compiles to the same thing but the old code was
definitely wrong.)
Review URL: http://codereview.chromium.org/1564037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44844 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/zygote_main_linux.cc')
-rw-r--r-- | chrome/browser/zygote_main_linux.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/zygote_main_linux.cc b/chrome/browser/zygote_main_linux.cc index 793c855..a7cfb76 100644 --- a/chrome/browser/zygote_main_linux.cc +++ b/chrome/browser/zygote_main_linux.cc @@ -196,7 +196,8 @@ class Zygote { Pickle write_pickle; write_pickle.WriteBool(did_crash); write_pickle.WriteBool(child_exited); - HANDLE_EINTR(write(fd, write_pickle.data(), write_pickle.size())); + if (HANDLE_EINTR(write(fd, write_pickle.data(), write_pickle.size()))) + PLOG(ERROR) << "write"; } // Handle a 'fork' request from the browser: this means that the browser @@ -305,7 +306,8 @@ class Zygote { i = fds.begin(); i != fds.end(); ++i) close(*i); - HANDLE_EINTR(write(fd, &proc_id, sizeof(proc_id))); + if (HANDLE_EINTR(write(fd, &proc_id, sizeof(proc_id))) < 0) + PLOG(ERROR) << "write"; return false; } |