freezer: make methods return bool

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