summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
Diffstat (limited to 'udev')
-rw-r--r--udev/udevadm-monitor.c1
-rw-r--r--udev/udevd.c8
2 files changed, 5 insertions, 4 deletions
diff --git a/udev/udevadm-monitor.c b/udev/udevadm-monitor.c
index 85252bb7d9..a587e8cc0f 100644
--- a/udev/udevadm-monitor.c
+++ b/udev/udevadm-monitor.c
@@ -133,7 +133,6 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[])
" --subsystem-match=<subsystem[/devtype]> filter events by subsystem\n"
" --tag-match=<tag> filter events by tag\n"
" --help\n\n");
- default:
goto out;
}
}
diff --git a/udev/udevd.c b/udev/udevd.c
index c785b20757..8610c6c062 100644
--- a/udev/udevd.c
+++ b/udev/udevd.c
@@ -744,9 +744,11 @@ static int handle_inotify(struct udev *udev)
info(udev, "device %s closed, synthesising 'change'\n", udev_device_get_devnode(dev));
util_strscpyl(filename, sizeof(filename), udev_device_get_syspath(dev), "/uevent", NULL);
fd = open(filename, O_WRONLY);
- if (fd < 0 || write(fd, "change", 6) < 0)
- info(udev, "error writing uevent: %m\n");
- close(fd);
+ if (fd >= 0) {
+ if (write(fd, "change", 6) < 0)
+ info(udev, "error writing uevent: %m\n");
+ close(fd);
+ }
}
if (ev->mask & IN_IGNORED)
udev_watch_end(udev, dev);