]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
loop-util: call loop_device_make_internal() at the right place 21061/head
authorLennart Poettering <lennart@poettering.net>
Wed, 20 Oct 2021 07:57:16 +0000 (09:57 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 20 Oct 2021 07:57:16 +0000 (09:57 +0200)
The whole reason loop_device_make_internal() exists (as opposed to just
loop_device_make()) is to avoid mangling the loop flags value/call
getenv twice. Hence let's actually call it when we already mangled the
flags value.

src/shared/loop-util.c

index f2f4ab481d4957669b3891d816f333fdde67d751..2da101b748beb1f5f7940fb1211f160eac6a6912 100644 (file)
@@ -695,7 +695,7 @@ int loop_device_make_by_path(
                   direct ? "enabled" : "disabled",
                   direct != (direct_flags != 0) ? " (O_DIRECT was requested but not supported)" : "");
 
-        return loop_device_make(fd, open_flags, 0, 0, loop_flags, ret);
+        return loop_device_make_internal(fd, open_flags, 0, 0, loop_flags, ret);
 }
 
 LoopDevice* loop_device_unref(LoopDevice *d) {