]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
loop-util: initialize .devno in loop_device_open() too
authorLennart Poettering <lennart@poettering.net>
Tue, 20 Apr 2021 15:10:45 +0000 (17:10 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 20 Apr 2021 15:12:39 +0000 (17:12 +0200)
src/shared/loop-util.c

index b8f7d0cc7bfafa9d41512af190619d3cadb00f51..ce4a72a24a9c12309d808d2e082abbc4459d8e89 100644 (file)
@@ -444,7 +444,12 @@ int loop_device_make(
         return d->fd;
 }
 
-int loop_device_make_by_path(const char *path, int open_flags, uint32_t loop_flags, LoopDevice **ret) {
+int loop_device_make_by_path(
+                const char *path,
+                int open_flags,
+                uint32_t loop_flags,
+                LoopDevice **ret) {
+
         _cleanup_close_ int fd = -1;
         int r;
 
@@ -567,6 +572,7 @@ int loop_device_open(const char *loop_path, int open_flags, LoopDevice **ret) {
                 .nr = nr,
                 .node = TAKE_PTR(p),
                 .relinquished = true, /* It's not ours, don't try to destroy it when this object is freed */
+                .devno = st.st_dev,
         };
 
         *ret = d;