Skip to content

Commit

Permalink
io/linux/ProcCgroup: ReadPidfdPid() returns signed integer
Browse files Browse the repository at this point in the history
The "Pid" line is -1 if the process has already exited and has been
reaped.
  • Loading branch information
MaxKellermann committed Nov 23, 2024
1 parent 268c2e9 commit 8529845
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/io/linux/ProcFdinfo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

using std::string_view_literals::operator""sv;

unsigned
int
ReadPidfdPid(FileDescriptor pidfd)
{
assert(pidfd.IsDefined());
Expand Down
5 changes: 4 additions & 1 deletion src/io/linux/ProcFdinfo.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ class FileDescriptor;
* line in /proc/self/fdinfo/PIDFD.
*
* Throws on error.
*
* @return the PID (or -1 if the process has already exited and has
* been reaped)
*/
unsigned
int
ReadPidfdPid(FileDescriptor pidfd);

0 comments on commit 8529845

Please sign in to comment.