diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-08-17 20:20:47 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-08-26 14:33:29 +0200 |
commit | a21eaa2a3a8b50567813a3d3e19f50ab1d8bd673 (patch) | |
tree | 1c73c2efe457d021457140fabff0a29af18e158d | |
parent | 3a2d169f3643cc37fa889b61dfba80794f3c99d1 (diff) | |
download | systemd-a21eaa2a3a8b50567813a3d3e19f50ab1d8bd673.tar.gz |
homework: correct error passed into log message
(cherry picked from commit 6d7b47eb3eb71b37c768e588173f2c8169e953e7)
-rw-r--r-- | src/home/homework-luks.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/home/homework-luks.c b/src/home/homework-luks.c index be296f1a4b..86c48c3f74 100644 --- a/src/home/homework-luks.c +++ b/src/home/homework-luks.c @@ -1110,7 +1110,9 @@ int home_prepare_luks( if (fstat(fd, &st) < 0) return log_error_errno(errno, "Failed to fstat() image file: %m"); if (!S_ISREG(st.st_mode) && !S_ISBLK(st.st_mode)) - return log_error_errno(errno, "Image file %s is not a regular file or block device: %m", ip); + return log_error_errno( + S_ISDIR(st.st_mode) ? SYNTHETIC_ERRNO(EISDIR) : SYNTHETIC_ERRNO(EBADFD), + "Image file %s is not a regular file or block device: %m", ip); r = luks_validate(fd, user_record_user_name_and_realm(h), h->partition_uuid, &found_partition_uuid, &offset, &size); if (r < 0) |