Skip to content

Commit fa123af

Browse files
author
MarcoFalke
committed
Reject + sign when checking -ipcfd
1 parent fa47985 commit fa123af

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ipc/process.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ class ProcessImpl : public Process
5555
// in combination with other arguments because the parent process
5656
// should be able to control the child process through the IPC protocol
5757
// without passing information out of band.
58-
if (!ParseInt32(argv[2], &fd)) {
58+
const auto maybe_fd{ToIntegral<int32_t>(argv[2])};
59+
if (!maybe_fd) {
5960
throw std::runtime_error(strprintf("Invalid -ipcfd number '%s'", argv[2]));
6061
}
62+
fd = *maybe_fd;
6163
return true;
6264
}
6365
int connect(const fs::path& data_dir,

0 commit comments

Comments
 (0)