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 <vogel@users.sourceforge.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
Robert Vogelgesang 2014-01-31 11:47:02 +01:00 committed by Stéphane Graber
parent a17b1e65fa
commit a52e315d12

View File

@ -1339,8 +1339,6 @@ static bool lxcapi_shutdown(struct lxc_container *c, int timeout)
if (!c) if (!c)
return false; return false;
if (!timeout)
timeout = -1;
if (!c->is_running(c)) if (!c->is_running(c))
return true; return true;
pid = c->init_pid(c); pid = c->init_pid(c);