]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
homed: don't use stat() data from an unrelated inode
authorLennart Poettering <lennart@poettering.net>
Mon, 29 Aug 2022 13:11:15 +0000 (15:11 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 29 Aug 2022 16:13:58 +0000 (01:13 +0900)
This doesn't really change anything, since we know the stat data used
here also contains S_IFBLK, but it's frickin' confusing.

src/home/homework-luks.c

index edf310f16d72a24a3a2041503a692ba2569075a2..68a5ac9c2e3c81c841a3430bd0bb6952611fe3ed 100644 (file)
@@ -3122,7 +3122,7 @@ int home_resize_luks(
 
                         log_info("Operating on partition device %s, using parent device.", ip);
 
-                        opened_image_fd = r = device_open_from_devnum(st.st_mode, parent, O_RDWR|O_CLOEXEC|O_NOCTTY|O_NONBLOCK, &whole_disk);
+                        opened_image_fd = r = device_open_from_devnum(S_IFBLK, parent, O_RDWR|O_CLOEXEC|O_NOCTTY|O_NONBLOCK, &whole_disk);
                         if (r < 0)
                                 return log_error_errno(r, "Failed to open whole block device for %s: %m", ip);