Patches to make Bochs 2.6.2 work with Pintos
[pintos-anon] / src / misc / bochs-2.6.2-block-device-check.patch
diff --git a/src/misc/bochs-2.6.2-block-device-check.patch b/src/misc/bochs-2.6.2-block-device-check.patch
new file mode 100644 (file)
index 0000000..a0b930c
--- /dev/null
@@ -0,0 +1,12 @@
+diff -Naur bochs-2.6.2/iodev/hdimage/hdimage.cc bochs-2.6.2.new/iodev/hdimage/hdimage.cc
+--- bochs-2.6.2/iodev/hdimage/hdimage.cc       2013-03-08 10:25:32.000000001 -0800
++++ bochs-2.6.2.new/iodev/hdimage/hdimage.cc   2014-01-10 06:54:24.000000001 -0800
+@@ -200,7 +200,7 @@
+       return -1;
+     }
+ #ifdef linux
+-    if (stat_buf.st_rdev) { // Is this a special device file (e.g. /dev/sde) ?
++    if (S_ISBLK(stat_buf.st_mode)) { // Is this a special device file (e.g. /dev/sde) ?
+       ioctl(fd, BLKGETSIZE64, fsize); // yes it's!
+     }
+     else