Commit 8c94bc85 by Greg Kurz Committed by Daniel Lezcano

assertion on lxc_checkpoint() return value

Buggy behaviour always deserves an assertion. Signed-off-by: 's avatarGreg Kurz <gkurz@fr.ibm.com> Signed-off-by: 's avatarCedric Le Goater <clg@fr.ibm.com> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent b3df193c
...@@ -21,6 +21,7 @@ ...@@ -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[]) ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment