From 0f03c2a4c093e3d44f4072144827e943c05c8904 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 22 Oct 2015 19:54:29 +0200 Subject: 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. --- src/tmpfiles/tmpfiles.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/tmpfiles') diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 693a3da2f4..1786e36674 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -2144,12 +2144,9 @@ static int parse_argv(int argc, char *argv[]) { break; 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 '?': -- cgit v1.2.3-54-g00ecf