From: Michael Kerrisk Date: Fri, 17 Jul 2020 07:13:31 +0000 (+0200) Subject: pidfd_open.2: Close the pidfd in EXAMPLE X-Git-Tag: man-pages-5.08~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cb61821b9d1ef399cc8261b159a6d92af0ceae2;p=thirdparty%2Fman-pages.git 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 --- diff --git a/man2/pidfd_open.2 b/man2/pidfd_open.2 index 1776700b01..dc5232760d 100644 --- a/man2/pidfd_open.2 +++ b/man2/pidfd_open.2 @@ -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