Changes by: aia21
Update of /cvs/linux-ntfs/ntfsprogs/libntfs
In directory delta357:/tmp/cvs-serv8669/libntfs
Modified Files:
device.c
Log Message:
If pread/pwrite are not supported by the OS, set the device pread()/pwrite()
pointers to NULL so we automatically use seek() + read()/write() from now on.
Index: device.c
===================================================================
RCS file: /cvs/linux-ntfs/ntfsprogs/libntfs/device.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -p -r1.32 -r1.33
--- device.c 9 Dec 2006 14:01:12 -0000 1.32
+++ device.c 10 Dec 2006 19:38:02 -0000 1.33
@@ -223,10 +223,12 @@ seek:
return total;
/*
* If pread is not supported by the OS, fall back to emulating
- * it by seek() + read().
+ * it by seek() + read() and set the device pread() pointer to
+ * NULL so we automatically use seek() + read() from now on.
*/
if (errno == ENOSYS && _pread != fake_pread) {
_pread = fake_pread;
+ dops->pread = NULL;
goto seek;
}
/* Nothing read and error, return error status. */
@@ -318,10 +320,13 @@ seek:
break;
/*
* If pwrite is not supported by the OS, fall back to emulating
- * it by seek() + write().
+ * it by seek() + write() and set the device pwrite() pointer
+ * to NULL so we automatically use seek() + write() from now
+ * on.
*/
if (errno == ENOSYS && _pwrite != fake_pwrite) {
_pwrite = fake_pwrite;
+ dops->pwrite = NULL;
goto seek;
}
/* Nothing written and error, return error status. */
|