chiark / gitweb /
shared: introduce cmsg_close_all() call
[elogind.git] / src / udev / udev-ctrl.c
index 538b34286561065bdf6a55d7e0676b74e67fa68e..59a3eceaadea7cc2959f4c8a52b7d87b3bec774e 100644 (file)
@@ -16,7 +16,7 @@
 #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>
 
@@ -377,6 +377,9 @@ struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl_connection *conn) {
                 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);