Commit 8479c136 by S.Çağlar Onur Committed by Stéphane Graber

rmdir and lxc_unpriv returns non-negative error codes

parent 06f976ca
...@@ -1419,7 +1419,7 @@ static int btrfs_snapshot(const char *orig, const char *new) ...@@ -1419,7 +1419,7 @@ static int btrfs_snapshot(const char *orig, const char *new)
goto out; goto out;
} }
// make sure the directory doesn't already exist // make sure the directory doesn't already exist
if (rmdir(newfull) < 0 && errno != -ENOENT) { if (rmdir(newfull) < 0 && errno != ENOENT) {
SYSERROR("Error removing empty new rootfs"); SYSERROR("Error removing empty new rootfs");
goto out; goto out;
} }
...@@ -1512,7 +1512,7 @@ static int btrfs_clonepaths(struct bdev *orig, struct bdev *new, const char *old ...@@ -1512,7 +1512,7 @@ static int btrfs_clonepaths(struct bdev *orig, struct bdev *new, const char *old
return userns_exec_1(conf, btrfs_snapshot_wrapper, &sdata); return userns_exec_1(conf, btrfs_snapshot_wrapper, &sdata);
} }
if (rmdir(new->dest) < 0 && errno != -ENOENT) { if (rmdir(new->dest) < 0 && errno != ENOENT) {
SYSERROR("removing %s", new->dest); SYSERROR("removing %s", new->dest);
return -1; return -1;
} }
......
...@@ -159,7 +159,7 @@ static int build_dir(const char *name) ...@@ -159,7 +159,7 @@ static int build_dir(const char *name)
*p = '\0'; *p = '\0';
if (access(n, F_OK)) { if (access(n, F_OK)) {
ret = lxc_unpriv(mkdir(n, 0755)); ret = lxc_unpriv(mkdir(n, 0755));
if (ret && errno != -EEXIST) { if (ret && errno != EEXIST) {
SYSERROR("failed to create directory '%s'.", n); SYSERROR("failed to create directory '%s'.", n);
free(n); free(n);
return -1; return -1;
......
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