termux-packages/root-packages/cryptsetup/fix-loopdev-path.patch

22 lines
645 B
Diff
Raw Normal View History

2018-05-26 18:23:37 +02:00
diff -uNr cryptsetup-2.0.3/lib/utils_loop.c cryptsetup-2.0.3.mod/lib/utils_loop.c
--- cryptsetup-2.0.3/lib/utils_loop.c 2018-02-28 11:20:59.000000000 +0200
+++ cryptsetup-2.0.3.mod/lib/utils_loop.c 2018-05-26 19:02:53.546906033 +0300
@@ -57,7 +57,7 @@
struct loop_info64 lo64 = {0};
for (i = 0; i < 256; i++) {
- sprintf(dev, "/dev/loop%d", i);
+ sprintf(dev, "/dev/block/loop%d", i);
loop_fd = open(dev, O_RDONLY);
if (loop_fd < 0)
@@ -91,7 +91,7 @@
}
close(loop_fd);
- if (sprintf(dev, "/dev/loop%d", i) < 0)
+ if (sprintf(dev, "/dev/block/loop%d", i) < 0)
return NULL;
if (stat(dev, &st) || !S_ISBLK(st.st_mode))