Fix the O_RDONLY vs O_RDWR check. It was failing because

O_RDONLY is zero and hence the old check was always successful.

(Logical change 1.153)
edge.strict_endians
cantab.net!aia21 2003-07-12 15:46:12 +00:00
parent c11d307758
commit 993640ad31
1 changed files with 1 additions and 1 deletions

View File

@ -174,7 +174,7 @@ static int ntfs_device_disk_io_open(struct ntfs_device *dev, int flags)
if (((int)dev->d_private = open(dev->d_name, flags)) == -1)
return -1;
/* Setup our read-only flag. */
if ((flags & O_RDONLY) == O_RDONLY)
if ((flags & O_RDWR) != O_RDWR)
NDevSetReadOnly(dev);
/* Acquire exlusive (mandatory) lock on the whole device. */
memset(&flk, 0, sizeof(flk));