summaryrefslogtreecommitdiff
path: root/src/nspawn/nspawn.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-22 19:28:31 +0200
committerLennart Poettering <lennart@poettering.net>2015-10-24 23:03:49 +0200
commit0f4743651081b5367ab06f238827ddfd4da74e74 (patch)
tree43b072e7eb30af4c4c80fa451768ecd8eb14a1d9 /src/nspawn/nspawn.c
parent85eca92e2061043d733991b386d8dc10fad0fc30 (diff)
util-lib: get_current_dir_name() can return errors other than ENOMEM
get_current_dir_name() can return a variety of errors, not just ENOMEM, hence don't blindly turn its errors to ENOMEM, but return correct errors in path_make_absolute_cwd(). This trickles down into a couple of other functions, some of which receive unrelated minor fixes too with this commit.
Diffstat (limited to 'src/nspawn/nspawn.c')
-rw-r--r--src/nspawn/nspawn.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 99e24cf4ff..056b4ce5f3 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -278,6 +278,7 @@ static int custom_mounts_prepare(void) {
static int set_sanitized_path(char **b, const char *path) {
char *p;
+ int r;
assert(b);
assert(path);
@@ -287,9 +288,9 @@ static int set_sanitized_path(char **b, const char *path) {
if (errno != ENOENT)
return -errno;
- p = path_make_absolute_cwd(path);
- if (!p)
- return -ENOMEM;
+ r = path_make_absolute_cwd(path, &p);
+ if (r < 0)
+ return r;
}
free(*b);