summaryrefslogtreecommitdiff
path: root/src/firstboot/firstboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/firstboot/firstboot.c')
-rw-r--r--src/firstboot/firstboot.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c
index 82ebb91788..5aa247b2ae 100644
--- a/src/firstboot/firstboot.c
+++ b/src/firstboot/firstboot.c
@@ -35,6 +35,8 @@
#include "strv.h"
#include "terminal-util.h"
#include "time-util.h"
+#include "string-util.h"
+#include "fd-util.h"
static char *arg_root = NULL;
static char *arg_locale = NULL; /* $LANG */
@@ -690,16 +692,9 @@ static int parse_argv(int argc, char *argv[]) {
return version();
case ARG_ROOT:
- free(arg_root);
- arg_root = path_make_absolute_cwd(optarg);
- if (!arg_root)
- return log_oom();
-
- path_kill_slashes(arg_root);
-
- if (path_equal(arg_root, "/"))
- arg_root = mfree(arg_root);
-
+ r = parse_path_argument_and_warn(optarg, true, &arg_root);
+ if (r < 0)
+ return r;
break;
case ARG_LOCALE: