]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
freezer: make methods return bool
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 2 Feb 2021 17:55:39 +0000 (18:55 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 2 Feb 2021 17:56:23 +0000 (18:56 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/freezer.c
src/lxc/lxc.h

index ae4d70f62ba2b6163cb2e9148d66f32d8a6d6e2c..b3ec92272c5be5f06c89fed007d7a96a3566dcd8 100644 (file)
@@ -68,7 +68,7 @@ static int do_freeze_thaw(bool freeze, struct lxc_conf *conf, const char *name,
        return 0;
 }
 
-int lxc_freeze(struct lxc_conf *conf, const char *name, const char *lxcpath)
+bool lxc_freeze(struct lxc_conf *conf, const char *name, const char *lxcpath)
 {
        int ret;
 
@@ -78,10 +78,10 @@ int lxc_freeze(struct lxc_conf *conf, const char *name, const char *lxcpath)
        else
                ret = do_freeze_thaw(true, conf, name, lxcpath);
        lxc_cmd_notify_state_listeners(name, lxcpath, !ret ? FROZEN : RUNNING);
-       return ret;
+       return ret == 0;
 }
 
-int lxc_unfreeze(struct lxc_conf *conf, const char *name, const char *lxcpath)
+bool lxc_unfreeze(struct lxc_conf *conf, const char *name, const char *lxcpath)
 {
        int ret;
 
@@ -91,5 +91,5 @@ int lxc_unfreeze(struct lxc_conf *conf, const char *name, const char *lxcpath)
        else
                ret = do_freeze_thaw(false, conf, name, lxcpath);
        lxc_cmd_notify_state_listeners(name, lxcpath, !ret ? RUNNING : FROZEN);
-       return ret;
+       return ret == 0;
 }
index f688b25c264a6b399486c03966ac1705d4328760..ec54aef83f62fc309c0fd92c7d2d57df61204879 100644 (file)
@@ -62,14 +62,14 @@ __hidden extern int lxc_monitor_close(int fd);
  * @name : the container name
  * Returns 0 on success, < 0 otherwise
  */
-__hidden extern int lxc_freeze(struct lxc_conf *conf, const char *name, const char *lxcpath);
+__hidden extern bool lxc_freeze(struct lxc_conf *conf, const char *name, const char *lxcpath);
 
 /*
  * Unfreeze all previously frozen tasks.
  * @name : the name of the container
  * Return 0 on success, < 0 otherwise
  */
-__hidden extern int lxc_unfreeze(struct lxc_conf *conf, const char *name, const char *lxcpath);
+__hidden extern bool lxc_unfreeze(struct lxc_conf *conf, const char *name, const char *lxcpath);
 
 /*
  * Retrieve the container state