[systemd-devel] [PATCH] udevadm-settle: fixed return code for empty queue

Harald Hoyer harald at redhat.com
Tue May 20 03:54:36 PDT 2014


On 20.05.2014 12:33, harald at redhat.com wrote:
> From: Harald Hoyer <harald at redhat.com>
> 
> If the udev queue is empty and "/run/udev/queue" does not exist,
> "udevadm settle" would return with EXIT_FAILURE, because the inotify on
> "/run/udev/queue" would fail with ENOENT.
> 
> This patch lets "udevadm settle" exit with EXIT_SUCCESS in this case.
> ---
>  src/udev/udevadm-settle.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/udev/udevadm-settle.c b/src/udev/udevadm-settle.c
> index 65fc35f..66fd843 100644
> --- a/src/udev/udevadm-settle.c
> +++ b/src/udev/udevadm-settle.c
> @@ -116,7 +116,11 @@ static int adm_settle(struct udev *udev, int argc, char *argv[])
>          }
>  
>          if (inotify_add_watch(pfd[0].fd, "/run/udev/queue" , IN_DELETE) < 0) {
> -                log_debug("watching /run/udev failed");
> +                /* If it does not exist, we don't have to wait */
> +                if (errno == ENOENT)
> +                        rc = EXIT_SUCCESS;
> +                else
> +                        log_debug("watching /run/udev/queue failed");
>                  goto out;
>          }
>  
> 

and pushed


More information about the systemd-devel mailing list