#include <unistd.h>
#include <string.h>
#include <errno.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <sys/prctl.h>
#include <stddef.h>
#include <getopt.h>
if (!c)
return NULL;
- close(c->fd);
+ safe_close(c->fd);
free(c);
return NULL;
if (r < 0)
goto exit;
+ c->fd = -1;
+
/* set comm to "p$PIDu$UID" and suffix with '*' if truncated */
r = snprintf(comm, sizeof(comm), "p" PID_FMT "u" UID_FMT, p->local_creds.pid, p->local_creds.uid);
if (r >= (ssize_t)sizeof(comm))