* --enable-fs hugetlbfs --enable-fs tracefs --ext-mount-map console:/dev/pts/n
* +1 for final NULL */
- if (strcmp(opts->action, "dump") == 0 || strcmp(opts->action, "pre-dump") == 0) {
+ if (strequal(opts->action, "dump") || strequal(opts->action, "pre-dump")) {
/* -t pid --freeze-cgroup /lxc/ct */
static_args += 4;
static_args += 5;
/* --leave-running (only for final dump) */
- if (strcmp(opts->action, "dump") == 0 && !opts->user->stop)
+ if (strequal(opts->action, "dump") && !opts->user->stop)
static_args++;
/* --external tty[88,4] */
/* --ghost-limit 1024 */
if (opts->user->ghost_limit)
static_args += 2;
- } else if (strcmp(opts->action, "restore") == 0) {
+ } else if (strequal(opts->action, "restore")) {
/* --root $(lxc_mount_point) --restore-detached
* --restore-sibling
* --lsm-profile apparmor:whatever
* the right cgroup is. if this is a restore, we can just use
* the handler the restore task created.
*/
- if (!strcmp(opts->action, "dump") || !strcmp(opts->action, "pre-dump")) {
+ if (strequal(opts->action, "dump") || strequal(opts->action, "pre-dump")) {
cgroup_base_path = lxc_cmd_get_limiting_cgroup_path(opts->c->name, opts->c->config_path, controllers_list[0]);
if (!cgroup_base_path)
return log_error_errno(-ENOENT, ENOENT, "Failed to retrieve limiting cgroup path for %s", controllers_list[0] ?: "(null)");
if (!(flags & MS_BIND))
continue;
- if (strcmp(opts->action, "dump") == 0)
+ if (strequal(opts->action, "dump"))
ret = strnprintf(arg, sizeof(arg), "/%s:%s", mntent.mnt_dir, mntent.mnt_dir);
else
ret = strnprintf(arg, sizeof(arg), "%s:%s", mntent.mnt_dir, mntent.mnt_fsname);
DECLARE_ARG(arg);
}
- if (strcmp(opts->action, "dump") == 0 || strcmp(opts->action, "pre-dump") == 0) {
+ if (strequal(opts->action, "dump") || strequal(opts->action, "pre-dump")) {
pid_t init_pid;
char init_pid_str[INTTYPE_TO_STRLEN(int)];
char *freezer_relative;
return log_error_errno(-EIO, EIO, "Failed to freezer cgroup entry");
if (!opts->user->disable_skip_in_flight &&
- strcmp(opts->criu_version, CRIU_IN_FLIGHT_SUPPORT) >= 0)
+ strcmp(opts->criu_version, CRIU_IN_FLIGHT_SUPPORT) >= 0)
DECLARE_ARG("--skip-in-flight");
DECLARE_ARG("--freeze-cgroup");
}
/* only for final dump */
- if (strcmp(opts->action, "dump") == 0 && !opts->user->stop)
+ if (strequal(opts->action, "dump") && !opts->user->stop)
DECLARE_ARG("--leave-running");
- } else if (strcmp(opts->action, "restore") == 0) {
+ } else if (strequal(opts->action, "restore")) {
struct lxc_conf *lxc_conf = opts->c->lxc_conf;
DECLARE_ARG("--root");
int ret;
struct stat sb;
- if (c->lxc_conf->console.path && !strcmp(c->lxc_conf->console.path, "none")) {
+ if (c->lxc_conf->console.path && strequal(c->lxc_conf->console.path, "none")) {
tty_id[0] = 0;
return 0;
}