]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Fix the timeout == 0 case in lxcapi_shutdown()
authorRobert Vogelgesang <vogel@users.sourceforge.net>
Fri, 31 Jan 2014 10:47:02 +0000 (11:47 +0100)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 31 Jan 2014 12:03:12 +0000 (12:03 +0000)
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 <vogel@users.sourceforge.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/lxccontainer.c

index 854be072275477b92ff13f53a5bb808cf565f4c3..a0a5af579d17e3cc63d94061e15a4f86040d1043 100644 (file)
@@ -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);