From: Robert Vogelgesang Date: Fri, 31 Jan 2014 10:47:02 +0000 (+0100) Subject: Fix the timeout == 0 case in lxcapi_shutdown() X-Git-Tag: lxc-1.0.0.beta4~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a52e315d12fa8ea682b7f58c999dab6d74c60e33;p=thirdparty%2Flxc.git Fix the timeout == 0 case in lxcapi_shutdown() The timeout argument should be handled as follows: -1 => Wait forever 0 => Don't wait > 0 => Wait for timeout seconds Without this patch, the 0 case is mapped to -1. Signed-off-by: Robert Vogelgesang Acked-by: Stéphane Graber --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 854be0722..a0a5af579 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -1339,8 +1339,6 @@ static bool lxcapi_shutdown(struct lxc_container *c, int timeout) if (!c) return false; - if (!timeout) - timeout = -1; if (!c->is_running(c)) return true; pid = c->init_pid(c);