diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2011-04-15 01:14:10 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2011-04-15 01:14:10 +0200 |
commit | fdf52f5e2a6c67bf5a709845b2b10621083f849a (patch) | |
tree | 55088d283e187bd0f75f79565ba778a3c21edd13 /libudev | |
parent | 135f3e8d0b4b4968908421b677c9ef2ba860b71d (diff) |
libudev: ctrl, monitor - use SOCK_NONBLOCK
Diffstat (limited to 'libudev')
-rw-r--r-- | libudev/libudev-ctrl.c | 2 | ||||
-rw-r--r-- | libudev/libudev-monitor.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/libudev/libudev-ctrl.c b/libudev/libudev-ctrl.c index 7fa2d1d535..a2133fff1c 100644 --- a/libudev/libudev-ctrl.c +++ b/libudev/libudev-ctrl.c @@ -91,7 +91,7 @@ struct udev_ctrl *udev_ctrl_new_from_socket_fd(struct udev *udev, const char *so return NULL; if (fd < 0) { - uctrl->sock = socket(AF_LOCAL, SOCK_SEQPACKET|SOCK_CLOEXEC, 0); + uctrl->sock = socket(AF_LOCAL, SOCK_SEQPACKET|SOCK_NONBLOCK|SOCK_CLOEXEC, 0); if (uctrl->sock < 0) { err(udev, "error getting socket: %m\n"); udev_ctrl_unref(uctrl); diff --git a/libudev/libudev-monitor.c b/libudev/libudev-monitor.c index 5d9e155722..d890b4b142 100644 --- a/libudev/libudev-monitor.c +++ b/libudev/libudev-monitor.c @@ -145,7 +145,7 @@ struct udev_monitor *udev_monitor_new_from_socket(struct udev *udev, const char util_strscpy(&udev_monitor->sun.sun_path[1], sizeof(udev_monitor->sun.sun_path)-1, socket_path); udev_monitor->addrlen = offsetof(struct sockaddr_un, sun_path) + strlen(socket_path)+1; } - udev_monitor->sock = socket(AF_LOCAL, SOCK_DGRAM|SOCK_CLOEXEC, 0); + udev_monitor->sock = socket(AF_LOCAL, SOCK_DGRAM|SOCK_NONBLOCK|SOCK_CLOEXEC, 0); if (udev_monitor->sock == -1) { err(udev, "error getting socket: %m\n"); free(udev_monitor); |