From: Christian Brauner Date: Tue, 2 Feb 2021 17:55:39 +0000 (+0100) Subject: freezer: make methods return bool X-Git-Tag: lxc-5.0.0~305^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4639029c9f6e3929d0b06af37e97b81f9f5853f3;p=thirdparty%2Flxc.git freezer: make methods return bool Signed-off-by: Christian Brauner --- diff --git a/src/lxc/freezer.c b/src/lxc/freezer.c index ae4d70f62..b3ec92272 100644 --- a/src/lxc/freezer.c +++ b/src/lxc/freezer.c @@ -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; } diff --git a/src/lxc/lxc.h b/src/lxc/lxc.h index f688b25c2..ec54aef83 100644 --- a/src/lxc/lxc.h +++ b/src/lxc/lxc.h @@ -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