chiark / gitweb /
tree-wide: Always use recvmsg with MSG_CMSG_CLOEXEC
[elogind.git] / src / shutdownd / shutdownd.c
index 826efbfeabb12a139508fa35d5c5dd47829e579a..6eb522bcfceed559d67f7d5da297044aaa6cf5ab 100644 (file)
@@ -69,7 +69,7 @@ static int read_packet(int fd, union shutdown_buffer *_b) {
         assert(fd >= 0);
         assert(_b);
 
-        n = recvmsg(fd, &msghdr, MSG_DONTWAIT);
+        n = recvmsg(fd, &msghdr, MSG_DONTWAIT|MSG_CMSG_CLOEXEC);
         if (n <= 0) {
                 if (n == 0) {
                         log_error("Short read");