summaryrefslogtreecommitdiff
path: root/src/udev/udev-ctrl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/udev/udev-ctrl.c')
-rw-r--r--src/udev/udev-ctrl.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/udev/udev-ctrl.c b/src/udev/udev-ctrl.c
index b8c0d83a02..d067279f3e 100644
--- a/src/udev/udev-ctrl.c
+++ b/src/udev/udev-ctrl.c
@@ -212,13 +212,11 @@ static int udev_ctrl_connection_event_handler(sd_event_source *s, int fd, uint32
if (size == 0)
return 0; /* Client disconnects? */
- size = recvmsg(fd, &smsg, 0);
- if (size < 0) {
- if (errno != EINTR)
- return log_error_errno(errno, "Failed to receive ctrl message: %m");
-
+ size = recvmsg_safe(fd, &smsg, 0);
+ if (size == -EINTR)
return 0;
- }
+ if (size < 0)
+ return log_error_errno(size, "Failed to receive ctrl message: %m");
cmsg_close_all(&smsg);