diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c index 3d33995bebb3a02054f52107572d33cf54177e89..4eff63014a951be1f6032912f94e2c31170e565a 100644 --- a/src/locking/lock_daemon.c +++ b/src/locking/lock_daemon.c @@ -872,7 +872,7 @@ int main(int argc, char **argv) { int pid_file_fd = -1; char *sock_file = NULL; char *admin_sock_file = NULL; - int timeout = -1; /* -t: Shutdown timeout */ + int timeout = 0; /* -t: Shutdown timeout */ char *state_file = NULL; bool implicit_conf = false; mode_t old_umask; @@ -922,7 +922,7 @@ int main(int argc, char **argv) { case 't': if (virStrToLong_i(optarg, &tmp, 10, &timeout) != 0 - || timeout <= 0 + || timeout < 0 /* Ensure that we can multiply by 1000 without overflowing. */ || timeout > INT_MAX / 1000) { VIR_ERROR(_("Invalid value for timeout")); @@ -1123,7 +1123,7 @@ int main(int argc, char **argv) { adminSrv = virNetDaemonGetServer(lockDaemon->dmn, "admin"); } - if (timeout != -1) { + if (timeout > 0) { VIR_DEBUG("Registering shutdown timeout %d", timeout); virNetDaemonAutoShutdown(lockDaemon->dmn, timeout); diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c index dcafcda926a0a66bcf2e4bfc9d66a2e4f2185228..f37054706e3724bab76b332edc034e14ce82450c 100644 --- a/src/logging/log_daemon.c +++ b/src/logging/log_daemon.c @@ -653,7 +653,7 @@ int main(int argc, char **argv) { int pid_file_fd = -1; char *sock_file = NULL; char *admin_sock_file = NULL; - int timeout = -1; /* -t: Shutdown timeout */ + int timeout = 0; /* -t: Shutdown timeout */ char *state_file = NULL; bool implicit_conf = false; mode_t old_umask; @@ -703,7 +703,7 @@ int main(int argc, char **argv) { case 't': if (virStrToLong_i(optarg, &tmp, 10, &timeout) != 0 - || timeout <= 0 + || timeout < 0 /* Ensure that we can multiply by 1000 without overflowing. */ || timeout > INT_MAX / 1000) { VIR_ERROR(_("Invalid value for timeout")); @@ -905,7 +905,7 @@ int main(int argc, char **argv) { adminSrv = virNetDaemonGetServer(logDaemon->dmn, "admin"); } - if (timeout != -1) { + if (timeout > 0) { VIR_DEBUG("Registering shutdown timeout %d", timeout); virNetDaemonAutoShutdown(logDaemon->dmn, timeout); diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c index a1552800e9ef73d9af5aeceba820fd613bb61f2a..7eec5991774ff2ccaca8fc0691a9924b2acc1e46 100644 --- a/src/remote/remote_daemon.c +++ b/src/remote/remote_daemon.c @@ -770,7 +770,7 @@ int main(int argc, char **argv) { char *sock_file = NULL; char *sock_file_ro = NULL; char *sock_file_adm = NULL; - int timeout = -1; /* -t: Shutdown timeout */ + int timeout = 0; /* -t: Shutdown timeout */ int verbose = 0; int godaemon = 0; #ifdef WITH_IP @@ -844,7 +844,7 @@ int main(int argc, char **argv) { case 't': if (virStrToLong_i(optarg, &tmp, 10, &timeout) != 0 - || timeout <= 0 + || timeout < 0 /* Ensure that we can multiply by 1000 without overflowing. */ || timeout > INT_MAX / 1000) { VIR_ERROR(_("Invalid value for timeout")); @@ -1107,7 +1107,7 @@ int main(int argc, char **argv) { goto cleanup; } - if (timeout != -1) { + if (timeout > 0) { VIR_DEBUG("Registering shutdown timeout %d", timeout); virNetDaemonAutoShutdown(dmn, timeout); }