summaryrefslogtreecommitdiff
path: root/src/firstboot/firstboot.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-10-25 14:22:43 +0100
committerTom Gundersen <teg@jklm.no>2015-10-25 14:22:43 +0100
commit7c8871d31510865e40c8628ef765996202a3cc00 (patch)
tree622b7aa085999fe3d2908772ff0d0c6ec5bf4400 /src/firstboot/firstboot.c
parent7c257428969aaba2acc4e26753c86d6f4774354a (diff)
parentf00022dd121c73b543ae667ddce9814bd67a1b73 (diff)
Merge pull request #1654 from poettering/util-lib
Various changes to src/basic/
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: