diff options
author | Luca Boccassi <bluca@debian.org> | 2023-11-16 22:13:10 +0100 |
---|---|---|
committer | Luca Boccassi <bluca@debian.org> | 2023-11-16 22:13:10 +0100 |
commit | d579c42e9d2e2c332d18fdd863019f80bef92af7 (patch) | |
tree | 21567a78ca448fdf3caaff1d6e6d48ccd75a0a89 /src/shared/loop-util.c | |
parent | loop-util: restart loop_configure and reopen FD when O_DIRECT fails (diff) | |
download | systemd-d579c42e9d2e2c332d18fdd863019f80bef92af7.tar.xz systemd-d579c42e9d2e2c332d18fdd863019f80bef92af7.zip |
loop-util: use the right error variable in log_debug_errno after fd_reopen
Diffstat (limited to '')
-rw-r--r-- | src/shared/loop-util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/loop-util.c b/src/shared/loop-util.c index fdf33fac2a..b11e9268af 100644 --- a/src/shared/loop-util.c +++ b/src/shared/loop-util.c @@ -489,10 +489,10 @@ static int loop_device_make_internal( reopened_fd = fd_reopen(fd, (FLAGS_SET(loop_flags, LO_FLAGS_DIRECT_IO) ? O_DIRECT : 0)|O_CLOEXEC|O_NONBLOCK|open_flags); if (reopened_fd < 0) { if (!FLAGS_SET(loop_flags, LO_FLAGS_DIRECT_IO)) - return log_debug_errno(errno, "Failed to reopen file descriptor without O_DIRECT: %m"); + return log_debug_errno(reopened_fd, "Failed to reopen file descriptor without O_DIRECT: %m"); /* Some file systems might not support O_DIRECT, let's gracefully continue without it then. */ - log_debug_errno(errno, "Failed to enable O_DIRECT for backing file descriptor for loopback device. Continuing without."); + log_debug_errno(reopened_fd, "Failed to enable O_DIRECT for backing file descriptor for loopback device. Continuing without."); loop_flags &= ~LO_FLAGS_DIRECT_IO; } else fd = reopened_fd; /* From now on, operate on our new O_DIRECT fd */ |