Skip to content

Commit

Permalink
Bug 1706526 - Check for failure to duplicate shared memory file descr…
Browse files Browse the repository at this point in the history
…iptors. r=nika

Differential Revision: https://phabricator.services.mozilla.com/D113139
  • Loading branch information
jld committed Apr 30, 2021
1 parent d7dc7b6 commit b787580
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ipc/chromium/src/base/shared_memory_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,11 @@ bool SharedMemory::ShareToProcessCommon(ProcessId processId,
bool close_self) {
freezeable_ = false;
const int new_fd = dup(mapped_file_.get());
DCHECK(new_fd >= -1);
if (new_fd < 0) {
CHROMIUM_LOG(WARNING) << "failed to duplicate file descriptor: "
<< strerror(errno);
return false;
}
new_handle->fd = new_fd;
new_handle->auto_close = true;

Expand Down

0 comments on commit b787580

Please sign in to comment.