e2fsprogs/ext2resize-nowrite.patch

21 lines
514 B
Diff

--- BUILD/ext2resize-1.1.19/src/ext2_unix_io.c
+++ BUILD/ext2resize-1.1.19/src/ext2_unix_io.c
@@ -256,7 +256,7 @@
goto error_free_cookie;
}
- if ((monster->fdwrite = open(dev, O_WRONLY | O_LARGEFILE)) < 0) {
+ if ((monster->fdwrite = open(dev, O_RDONLY | O_LARGEFILE)) < 0) {
char msg[4097];
snprintf(msg, 4096, "%s: writing %s", prog, dev);
@@ -301,7 +301,7 @@
return dh;
error_close_write:
- close(monster->fdread);
+ close(monster->fdwrite);
error_close_read:
close(monster->fdread);