printf(" -p: use container orig from custom lxcpath\n");
printf(" -P: create container new in custom lxcpath\n");
printf(" -R: rename existing container\n");
- exit(1);
+ exit(EXIT_SUCCESS);
}
static struct option options[] = {
{
printf("Usage: %s -l: list all available configuration items\n", me);
printf(" %s item: print configuration item\n", me);
- exit(1);
+ exit(EXIT_SUCCESS);
}
static void list_config_items(void)
for (i = &items[0]; i->name; i++)
printf("%s\n", i->name);
- exit(0);
+ exit(EXIT_SUCCESS);
}
int main(int argc, char *argv[])
if (p < 0) {
SYSERROR("failed to fork task.");
- exit(1);
+ exit(EXIT_FAILURE);
}
if (p == 0) {
/* Iterate through the interfaces */
for (tempIfAddr = interfaceArray; tempIfAddr != NULL; tempIfAddr = tempIfAddr->ifa_next) {
if (strcmp(tempIfAddr->ifa_name, dev_name) == 0) {
- exit(0);
+ exit(EXIT_SUCCESS);
}
}
- exit(1);
+ exit(EXIT_FAILURE);
}
if (wait_for_pid(p) == 0) {
fprintf(stderr, "\t -H <hostname>: Set the hostname in the container\n");
fprintf(stderr, "\t -d : Daemonize (do not wait for container to exit)\n");
fprintf(stderr, "\t -M : reMount default fs inside container (/proc /dev/shm /dev/mqueue)\n");
- _exit(1);
+ _exit(EXIT_SUCCESS);
}
static bool lookup_user(const char *optarg, uid_t *uid)
if ((flags & CLONE_NEWUTS) && want_hostname)
if (sethostname(want_hostname, strlen(want_hostname)) < 0) {
ERROR("failed to set hostname %s: %s", want_hostname, strerror(errno));
- exit(1);
+ exit(EXIT_FAILURE);
}
// Setuid is useful even without a new user id space
if (start_arg->setuid && setuid(uid)) {
ERROR("failed to set uid %d: %s", uid, strerror(errno));
- exit(1);
+ exit(EXIT_FAILURE);
}
execvp(args[0], args);
case 'i':
if (!(tmpif = malloc(sizeof(*tmpif)))) {
perror("malloc");
- exit(1);
+ exit(EXIT_FAILURE);
}
tmpif->mi_ifname = optarg;
tmpif->mi_next = my_iflist;
}
if (daemonize)
- exit(0);
+ exit(EXIT_SUCCESS);
if (waitpid(pid, &status, 0) < 0) {
ERROR("failed to wait for '%d'", pid);
printf(" Note: This program uses newuidmap(2) and newgidmap(2).\n");
printf(" As such, /etc/subuid and /etc/subgid must grant the\n");
printf(" calling user permission to use the mapped ranges\n");
- exit(1);
+ exit(EXIT_SUCCESS);
}
static void opentty(const char * tty, int which) {