[systemd-devel] [PATCH v3 1/2] udev: settle should return immediately when timeout is 0
David Herrmann
dh.herrmann at gmail.com
Mon Apr 20 09:49:45 PDT 2015
Hi
On Sun, Apr 19, 2015 at 2:41 AM, Nir Soffer <nirsof at gmail.com> wrote:
> udevadm manual says:
>
> A value of 0 will check if the queue is empty and always return
> immediately.
>
> However, currently we ignore the deadline if the value is 0, and wait
> without any limit.
>
> Zero timeout behaved according to the documentation until commit
> ead7c62ab7 (udevadm: settle - kill alarm()). Looking at this patch, it
> seems that the behavior change was unintended.
>
> This patch restores the documented behavior.
> ---
> src/udev/udevadm-settle.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
After a discussion with Kay:
Applied!
Thanks
David
> diff --git a/src/udev/udevadm-settle.c b/src/udev/udevadm-settle.c
> index 2c84ada..437c794 100644
> --- a/src/udev/udevadm-settle.c
> +++ b/src/udev/udevadm-settle.c
> @@ -142,7 +142,7 @@ static int adm_settle(struct udev *udev, int argc, char *argv[]) {
> break;
> }
>
> - if (timeout > 0 && now(CLOCK_MONOTONIC) >= deadline)
> + if (now(CLOCK_MONOTONIC) >= deadline)
> break;
>
> /* wake up when queue is empty */
> --
> 1.9.3
>
> _______________________________________________
> 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