diff options
author | Lennart Poettering <lennart@poettering.net> | 2022-08-22 12:34:34 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2022-08-23 15:10:15 +0200 |
commit | 45519d13a4f2a3c3585e672595762ca621abe65e (patch) | |
tree | 8680b032714ce1b7f823049d1e71b6ecb4b7e308 /src/systemctl/systemctl-edit.c | |
parent | Merge pull request #24412 from keszybz/man-similarly (diff) | |
download | systemd-45519d13a4f2a3c3585e672595762ca621abe65e.tar.xz systemd-45519d13a4f2a3c3585e672595762ca621abe65e.zip |
tree-wide: port things dirname_malloc() → path_extract_directory()
Diffstat (limited to 'src/systemctl/systemctl-edit.c')
-rw-r--r-- | src/systemctl/systemctl-edit.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/systemctl/systemctl-edit.c b/src/systemctl/systemctl-edit.c index 446dfd7dd6..a363d7a494 100644 --- a/src/systemctl/systemctl-edit.c +++ b/src/systemctl/systemctl-edit.c @@ -579,9 +579,9 @@ end: if (!arg_full) { _cleanup_free_ char *dir = NULL; - dir = dirname_malloc(*original); - if (!dir) - return log_oom(); + r = path_extract_directory(*original, &dir); + if (r < 0) + return log_error_errno(r, "Failed to extract directory from '%s': %m", *original); /* No need to check if the dir is empty, rmdir does nothing if it is not the case. */ (void) rmdir(dir); |