udev: Fix ping timeout when settle timeout is 0

When running udevadm settle --timeout=0, the ping always times out, and
udevadm will return 0 without checking the queue state.

(David: Use a reasonable timeout to still get the barrier provided by
 ctrl-ping)
This commit is contained in:
Nir Soffer 2015-04-19 02:49:47 +03:00 committed by David Herrmann
parent 6d785b6d07
commit 7375b3c487
1 changed files with 1 additions and 1 deletions

View File

@ -107,7 +107,7 @@ static int adm_settle(struct udev *udev, int argc, char *argv[]) {
uctrl = udev_ctrl_new(udev);
if (uctrl != NULL) {
if (udev_ctrl_send_ping(uctrl, timeout) < 0) {
if (udev_ctrl_send_ping(uctrl, MAX(5U, timeout)) < 0) {
log_debug("no connection to daemon");
udev_ctrl_unref(uctrl);
return EXIT_SUCCESS;