[systemd-devel] [PATCH 3/3] udev: avoid use of uninitialized err
Zbigniew Jędrzejewski-Szmek
zbyszek at in.waw.pl
Fri May 16 19:26:02 PDT 2014
On Fri, May 16, 2014 at 11:53:25PM +0200, Thomas H.P. Andersen wrote:
> From: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
>
> After 1ea972174baba40dbc80c51cbfc4edc49764b59b err is no longer
> set unless we hit a special case. Initialize it to 0 and remove
> a check that will never fail.
Looks good too.
Zbyszek
> src/udev/udevd.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/udev/udevd.c b/src/udev/udevd.c
> index bc0696c..1c9488e 100644
> --- a/src/udev/udevd.c
> +++ b/src/udev/udevd.c
> @@ -267,7 +267,7 @@ static void worker_new(struct event *event)
> struct udev_event *udev_event;
> struct worker_message msg;
> int fd_lock = -1;
> - int err;
> + int err = 0;
>
> log_debug("seq %llu running", udev_device_get_seqnum(dev));
> udev_event = udev_event_new(dev);
> @@ -312,7 +312,7 @@ static void worker_new(struct event *event)
> udev_event_execute_run(udev_event, &sigmask_orig);
>
> /* apply/restore inotify watch */
> - if (err == 0 && udev_event->inotify_watch) {
> + if (udev_event->inotify_watch) {
> udev_watch_begin(udev, dev);
> udev_device_update_db(dev);
> }
> --
> 1.9.0
>
> _______________________________________________
> 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