summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-04-13 01:47:56 +0200
committerKay Sievers <kay.sievers@vrfy.org>2011-04-13 01:47:56 +0200
commite48e2912023b5600d291904b0f7b0017387e8cb2 (patch)
treec2a4d569cbeca5102e89c0be1357d77aea0fe947 /udev
parentff2c503df091e6e4e9ab48cdb6df6ec8b7b525d0 (diff)
trivial cleanups
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);