assertion on lxc_checkpoint() return value

Buggy behaviour always deserves an assertion.

Signed-off-by: Greg Kurz <gkurz@fr.ibm.com>
Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
This commit is contained in:
Greg Kurz 2010-05-28 14:29:05 +02:00 committed by Daniel Lezcano
parent b3df193c50
commit 8c94bc8551

View File

@ -21,6 +21,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#define _GNU_SOURCE #define _GNU_SOURCE
#include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
@ -128,6 +129,9 @@ int main(int argc, char *argv[])
} }
ret = lxc_checkpoint(my_args.name, sfd, my_args.flags); ret = lxc_checkpoint(my_args.name, sfd, my_args.flags);
assert(ret == 0 || ret == -1);
if (ret) if (ret)
ERROR("failed to checkpoint '%s'", my_args.name); ERROR("failed to checkpoint '%s'", my_args.name);
else else