]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/loop-util: operate on the right fd
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 6 Dec 2019 09:39:14 +0000 (10:39 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 6 Dec 2019 09:39:14 +0000 (10:39 +0100)
'loop' is always -1 at this point in the code.

src/shared/loop-util.c

index acf3eae2d72cfbc40d7a3360b30ae00908234e5a..05b0d51d979567192911123669c025891e54b445 100644 (file)
@@ -44,7 +44,7 @@ int loop_device_make_full(
                 return -errno;
 
         if (S_ISBLK(st.st_mode)) {
-                if (ioctl(loop, LOOP_GET_STATUS64, &info) >= 0) {
+                if (ioctl(fd, LOOP_GET_STATUS64, &info) >= 0) {
                         /* Oh! This is a loopback device? That's interesting! */
 
 #if HAVE_VALGRIND_MEMCHECK_H