Changes by: antona
Update of /cvsroot/linux-ntfs/ntfsprogs/libntfs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26651/libntfs
Modified Files:
unix_io.c
Log Message:
Only use O_EXCL if mounting r/w.
Index: unix_io.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/unix_io.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -p -r1.11 -r1.12
--- unix_io.c 3 Feb 2006 23:11:35 -0000 1.11
+++ unix_io.c 4 Feb 2006 02:42:42 -0000 1.12
@@ -90,9 +90,11 @@ static int ntfs_device_unix_io_open(stru
return -1;
/*
* Open the device/file obtaining the file descriptor for exclusive
- * access.
+ * access (but only if mounting r/w).
*/
- *(int*)dev->d_private = open(dev->d_name, flags | O_EXCL);
+ if ((flags & O_RDWR) == O_RDWR)
+ flags |= O_EXCL;
+ *(int*)dev->d_private = open(dev->d_name, flags);
if (*(int*)dev->d_private == -1) {
err = errno;
goto err_out;
|