summaryrefslogtreecommitdiff
path: root/udev/udevd.c
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/udevd.c
parentff2c503df091e6e4e9ab48cdb6df6ec8b7b525d0 (diff)
trivial cleanups
Diffstat (limited to 'udev/udevd.c')
-rw-r--r--udev/udevd.c8
1 files changed, 5 insertions, 3 deletions
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);