From: Zbigniew Jędrzejewski-Szmek Date: Mon, 18 May 2026 10:33:08 +0000 (+0200) Subject: repart: fix bogus errno in error message and returned value X-Git-Tag: v261-rc1~116^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a333585fe3c825430910bd5953e6b3956bb9944;p=thirdparty%2Fsystemd.git repart: fix bogus errno in error message and returned value Reported by qarmin (Rafał Mikrut). --- diff --git a/src/repart/repart.c b/src/repart/repart.c index dca90f2509e..133a8e02118 100644 --- a/src/repart/repart.c +++ b/src/repart/repart.c @@ -3442,8 +3442,8 @@ static int context_copy_from_one(Context *context, const char *src) { if (!np->copy_blocks_path) return log_oom(); - np->copy_blocks_fd = fcntl(fd, F_DUPFD_CLOEXEC, 3); - if (np->copy_blocks_fd < 0) + np->copy_blocks_fd = r = RET_NERRNO(fcntl(fd, F_DUPFD_CLOEXEC, 3)); + if (r < 0) return log_error_errno(r, "Failed to duplicate file descriptor of %s: %m", src); np->copy_blocks_offset = start;