*/
if (argv)
for (nargs = 0; argv[nargs]; nargs++) ;
- nargs += 4; // template, path, rootfs and name args
+ nargs += 4; // template, path, rootfs and name args
newargv = malloc(nargs * sizeof(*newargv));
if (!newargv)
exit(1);
}
int hostid_mapped = mapped_hostid(geteuid(), conf);
- int extraargs = hostid_mapped >= 0 ? 1 : 3;
+ int extraargs = hostid_mapped >= 0 ? 1 : 3;
n2 = realloc(n2, (nargs + n2args + extraargs) * sizeof(char *));
if (!n2)
exit(1);
/* close the write-end of the pipe, thus sending EOF to the reader */
close(pipefd[1]);
exit(ret);
- }
+ }
/* close the write-end of the pipe */
close(pipefd[1]);
return -1;
int ret = -1;
if (strncmp(key, "lxc.network.", 12) == 0)
- ret = lxc_list_nicconfigs(c->lxc_conf, key, retv, inlen);
+ ret = lxc_list_nicconfigs(c->lxc_conf, key, retv, inlen);
container_mem_unlock(c);
return ret;
}
if (!alt_file)
alt_file = c->configfile;
if (!alt_file)
- return false; // should we write to stdout if no file is specified?
+ return false; // should we write to stdout if no file is specified?
// If we haven't yet loaded a config, load the stock config
if (!c->lxc_conf) {
if (len == 0)
break;
ret = write(out, buf, len);
- if (ret < len) { // should we retry?
+ if (ret < len) { // should we retry?
SYSERROR("Error: write to new file %s was interrupted", new);
goto err;
}
if (fprintf(fout, "%s", c->name) < 0) {
fclose(fout);
return -1;
- }
+ }
if (fclose(fout) < 0)
return -1;
}
n = newname ? newname : c->name;
l = lxcpath ? lxcpath : c->get_config_path(c);
ret = snprintf(newpath, MAXPATHLEN, "%s/%s/config", l, n);
- if (ret < 0 || ret >= MAXPATHLEN) {
+ if (ret < 0 || ret >= MAXPATHLEN) {
SYSERROR("clone: failed making config pathname");
goto out;
}
/* create the device node */
if (mknod(path, st.st_mode, st.st_rdev) < 0) {
ERROR("mknod failed");
- goto out;
+ goto out;
}
/* add device node to device list */