| Index: ipc/ipc_channel_posix.cc
|
| ===================================================================
|
| --- ipc/ipc_channel_posix.cc (revision 49995)
|
| +++ ipc/ipc_channel_posix.cc (working copy)
|
| @@ -93,8 +93,7 @@
|
|
|
| ChannelToFDMap::iterator i = map_.find(channel_id);
|
| if (i != map_.end()) {
|
| - if (HANDLE_EINTR(close(i->second)) < 0)
|
| - PLOG(ERROR) << "close";
|
| + HANDLE_EINTR(close(i->second));
|
| map_.erase(i);
|
| }
|
| }
|
| @@ -156,8 +155,7 @@
|
|
|
| // Make socket non-blocking
|
| if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1) {
|
| - if (HANDLE_EINTR(close(fd)) < 0)
|
| - PLOG(ERROR) << "close";
|
| + HANDLE_EINTR(close(fd));
|
| return false;
|
| }
|
|
|
| @@ -175,16 +173,14 @@
|
| // Bind the socket.
|
| if (bind(fd, reinterpret_cast<const sockaddr*>(&unix_addr),
|
| unix_addr_len) != 0) {
|
| - if (HANDLE_EINTR(close(fd)) < 0)
|
| - PLOG(ERROR) << "close";
|
| + HANDLE_EINTR(close(fd));
|
| return false;
|
| }
|
|
|
| // Start listening on the socket.
|
| const int listen_queue_length = 1;
|
| if (listen(fd, listen_queue_length) != 0) {
|
| - if (HANDLE_EINTR(close(fd)) < 0)
|
| - PLOG(ERROR) << "close";
|
| + HANDLE_EINTR(close(fd));
|
| return false;
|
| }
|
|
|
| @@ -222,8 +218,7 @@
|
| // Make socket non-blocking
|
| if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1) {
|
| LOG(ERROR) << "fcntl failed";
|
| - if (HANDLE_EINTR(close(fd)) < 0)
|
| - PLOG(ERROR) << "close";
|
| + HANDLE_EINTR(close(fd));
|
| return false;
|
| }
|
|
|
| @@ -238,8 +233,7 @@
|
|
|
| if (HANDLE_EINTR(connect(fd, reinterpret_cast<sockaddr*>(&server_unix_addr),
|
| server_unix_addr_len)) != 0) {
|
| - if (HANDLE_EINTR(close(fd)) < 0)
|
| - PLOG(ERROR) << "close";
|
| + HANDLE_EINTR(close(fd));
|
| return false;
|
| }
|
|
|
| @@ -321,10 +315,8 @@
|
| if (fcntl(pipe_fds[0], F_SETFL, O_NONBLOCK) == -1 ||
|
| fcntl(pipe_fds[1], F_SETFL, O_NONBLOCK) == -1) {
|
| PLOG(ERROR) << "fcntl(O_NONBLOCK)";
|
| - if (HANDLE_EINTR(close(pipe_fds[0])) < 0)
|
| - PLOG(ERROR) << "close";
|
| - if (HANDLE_EINTR(close(pipe_fds[1])) < 0)
|
| - PLOG(ERROR) << "close";
|
| + HANDLE_EINTR(close(pipe_fds[0]));
|
| + HANDLE_EINTR(close(pipe_fds[1]));
|
| return false;
|
| }
|
|
|
| @@ -542,8 +534,7 @@
|
| << " cmsg_len:" << cmsg->cmsg_len
|
| << " fd:" << pipe_;
|
| for (unsigned i = 0; i < num_wire_fds; ++i)
|
| - if (HANDLE_EINTR(close(wire_fds[i])) < 0)
|
| - PLOG(ERROR) << "close" << i;
|
| + HANDLE_EINTR(close(wire_fds[i]));
|
| return false;
|
| }
|
| break;
|
| @@ -623,8 +614,7 @@
|
| << " cmsg_len:" << cmsg->cmsg_len
|
| << " fd:" << pipe_;
|
| for (unsigned i = 0; i < num_wire_fds; ++i)
|
| - if (HANDLE_EINTR(close(wire_fds[i])) < 0)
|
| - PLOG(ERROR) << "close" << i;
|
| + HANDLE_EINTR(close(wire_fds[i]));
|
| return false;
|
| }
|
| break;
|
| @@ -670,8 +660,7 @@
|
| #endif
|
| // close the existing file descriptors so that we don't leak them
|
| for (unsigned i = fds_i; i < num_fds; ++i)
|
| - if (HANDLE_EINTR(close(fds[i])) < 0)
|
| - PLOG(ERROR) << "close" << i;
|
| + HANDLE_EINTR(close(fds[i]));
|
| input_overflow_fds_.clear();
|
| // abort the connection
|
| return false;
|
| @@ -1004,8 +993,7 @@
|
| server_listen_connection_watcher_.StopWatchingFileDescriptor();
|
|
|
| if (server_listen_pipe_ != -1) {
|
| - if (HANDLE_EINTR(close(server_listen_pipe_)) < 0)
|
| - PLOG(ERROR) << "close";
|
| + HANDLE_EINTR(close(server_listen_pipe_));
|
| server_listen_pipe_ = -1;
|
| }
|
|
|
| @@ -1013,8 +1001,7 @@
|
| read_watcher_.StopWatchingFileDescriptor();
|
| write_watcher_.StopWatchingFileDescriptor();
|
| if (pipe_ != -1) {
|
| - if (HANDLE_EINTR(close(pipe_)) < 0)
|
| - PLOG(ERROR) << "close";
|
| + HANDLE_EINTR(close(pipe_));
|
| pipe_ = -1;
|
| }
|
| if (client_pipe_ != -1) {
|
| @@ -1023,13 +1010,11 @@
|
| }
|
| #if !defined(OS_MACOSX)
|
| if (fd_pipe_ != -1) {
|
| - if (HANDLE_EINTR(close(fd_pipe_)) < 0)
|
| - PLOG(ERROR) << "close";
|
| + HANDLE_EINTR(close(fd_pipe_));
|
| fd_pipe_ = -1;
|
| }
|
| if (remote_fd_pipe_ != -1) {
|
| - if (HANDLE_EINTR(close(remote_fd_pipe_)) < 0)
|
| - PLOG(ERROR) << "close";
|
| + HANDLE_EINTR(close(remote_fd_pipe_));
|
| remote_fd_pipe_ = -1;
|
| }
|
| #endif
|
| @@ -1048,8 +1033,7 @@
|
| // Close any outstanding, received file descriptors
|
| for (std::vector<int>::iterator
|
| i = input_overflow_fds_.begin(); i != input_overflow_fds_.end(); ++i) {
|
| - if (HANDLE_EINTR(close(*i)) < 0)
|
| - PLOG(ERROR) << "close";
|
| + HANDLE_EINTR(close(*i));
|
| }
|
| input_overflow_fds_.clear();
|
| }
|
|
|