static WaitUntil arg_wait_until = WAIT_UNTIL_INITIALIZED;
static usec_t arg_timeout_usec = USEC_INFINITY;
+static bool arg_removed = false;
static bool arg_settle = false;
static char **arg_devices = NULL;
break;
OPTION_LONG("removed", NULL, "Wait for devices being removed"):
- arg_wait_until = WAIT_UNTIL_REMOVED;
+ arg_removed = true;
break;
OPTION_LONG("settle", NULL, "Also wait for all queued events being processed"):
break;
}
+ if (arg_removed)
+ arg_wait_until = WAIT_UNTIL_REMOVED;
+
char **args = option_parser_get_args(&opts);
if (strv_isempty(args))
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
udevadm wait --initialized true /sys/class/net/$netdev
udevadm wait --initialized false /sys/class/net/$netdev
(! udevadm wait --initialized hello /sys/class/net/$netdev)
+udevadm wait --timeout=0 --removed /dev/no-such-test-device
+udevadm wait --timeout=0 --removed --initialized=no /dev/no-such-test-device
+udevadm wait --timeout=0 --initialized=no --removed /dev/no-such-test-device
assert_rc 124 timeout 5 udevadm wait --removed /sys/class/net/$netdev
udevadm wait --settle /sys/class/net/$netdev
udevadm wait -h