chiark / gitweb /
fsckd: free client event source before we close its fd
[elogind.git] / src / udev / udev-ctrl.c
index 47f06510c8ee9c8500a9e7f96f65bcdbcaebef69..c0c5981db8c5a3a1e9619bdaa770d8afeaa9973c 100644 (file)
  */
 
 #include <errno.h>
-#include <stdio.h>
 #include <stdlib.h>
 #include <stddef.h>
 #include <string.h>
 #include <unistd.h>
-#include <sys/types.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 
@@ -372,11 +370,14 @@ struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl_connection *conn) {
         iov.iov_base = &uctrl_msg->ctrl_msg_wire;
         iov.iov_len = sizeof(struct udev_ctrl_msg_wire);
 
-        size = recvmsg(conn->sock, &smsg, MSG_CMSG_CLOEXEC);
+        size = recvmsg(conn->sock, &smsg, 0);
         if (size <  0) {
                 log_error_errno(errno, "unable to receive ctrl message: %m");
                 goto err;
         }
+
+        cmsg_close_all(&smsg);
+
         cmsg = CMSG_FIRSTHDR(&smsg);
         cred = (struct ucred *) CMSG_DATA(cmsg);