summaryrefslogtreecommitdiff
path: root/src/firstboot
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-22 19:54:29 +0200
committerLennart Poettering <lennart@poettering.net>2015-10-24 23:03:49 +0200
commit0f03c2a4c093e3d44f4072144827e943c05c8904 (patch)
tree70232d1b14b4dfcd82983894d13963e2ca9f4fec /src/firstboot
parent0f4743651081b5367ab06f238827ddfd4da74e74 (diff)
path-util: unify how we process paths specified on the command line
Let's introduce a common function that makes relative paths absolute and warns about any errors while doing so.
Diffstat (limited to 'src/firstboot')
-rw-r--r--src/firstboot/firstboot.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c
index cee05de7a1..cc564d5cd8 100644
--- a/src/firstboot/firstboot.c
+++ b/src/firstboot/firstboot.c
@@ -690,12 +690,9 @@ static int parse_argv(int argc, char *argv[]) {
return version();
case ARG_ROOT:
- arg_root = mfree(arg_root);
- r = path_make_absolute_cwd(optarg, &arg_root);
+ r = parse_path_argument_and_warn(optarg, true, &arg_root);
if (r < 0)
- return log_error_errno(r, "Failed to make root path absolute: %m");
-
- path_kill_slashes(arg_root);
+ return r;
break;
case ARG_LOCALE: