pidfd_open.2: Close the pidfd in EXAMPLE

Close the PID file descriptor in the example program, to hint to
the reader that like every other kind of file descriptor, a PID FD
should be closed.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2020-07-17 09:13:31 +02:00
parent f4fb9919e1
commit 7cb61821b9
1 changed files with 1 additions and 0 deletions

View File

@ -256,6 +256,7 @@ main(int argc, char *argv[])
printf("Events (0x%x): POLLIN is %sset\en", pollfd.revents,
(pollfd.revents & POLLIN) ? "" : "not ");
close(pidfd);
exit(EXIT_SUCCESS);
}
.fi