[systemd-devel] [systemd-commits] src/udev
Lennart Poettering
lennart at poettering.net
Mon Mar 9 10:06:55 PDT 2015
On Mon, 09.03.15 10:00, Tom Gundersen (tomegun at kemper.freedesktop.org) wrote:
> +static void event_queue_update(void) {
> + if (!udev_list_node_is_empty(&event_list)) {
> + int fd;
> +
> + fd = open("/run/udev/queue", O_WRONLY|O_CREAT|O_CLOEXEC|O_TRUNC|O_NOFOLLOW, 0444);
> + if (fd >= 0)
> + close(fd);
Isn't this a candidate for touch() or touch_file()?
> + } else
> + unlink("/run/udev/queue");
> +}
Not that it would matter much, but I think we should generally prefix
syscalls whose return code we ignore knowingly with a (void) cast, so
that Coverity doesn't ever get the idea we'd ignore the return value
by accident...
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list