From: Lennart Poettering Date: Wed, 21 Apr 2021 21:22:26 +0000 (+0200) Subject: repart: don't use basename() when we called path_extract_filename() anyway already X-Git-Tag: v249-rc1~359^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e28190673ca83d62692dae6d791161bece820030;p=thirdparty%2Fsystemd.git repart: don't use basename() when we called path_extract_filename() anyway already We already have the string, use it. --- diff --git a/src/partition/repart.c b/src/partition/repart.c index 9e297f19b9a..7809641fc88 100644 --- a/src/partition/repart.c +++ b/src/partition/repart.c @@ -2858,7 +2858,7 @@ static int do_copy_files(Partition *p, const char *fs) { if (pfd < 0) return log_error_errno(pfd, "Failed to open parent directory of target: %m"); - tfd = openat(pfd, basename(*target), O_CREAT|O_EXCL|O_WRONLY|O_CLOEXEC, 0700); + tfd = openat(pfd, fn, O_CREAT|O_EXCL|O_WRONLY|O_CLOEXEC, 0700); if (tfd < 0) return log_error_errno(errno, "Failed to create target file '%s': %m", *target);