[systemd-devel] [systemd-commits] src/udev

Tom Gundersen teg at jklm.no
Mon Mar 9 14:22:27 PDT 2015


Makes sense. Made some changes now.

On Mon, Mar 9, 2015 at 6:06 PM, Lennart Poettering
<lennart at poettering.net> wrote:
> 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
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel


More information about the systemd-devel mailing list