From 993640ad31deb1d88aa27dc75af58af13af37265 Mon Sep 17 00:00:00 2001 From: "cantab.net!aia21" Date: Sat, 12 Jul 2003 15:46:12 +0000 Subject: [PATCH] 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) --- libntfs/disk_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libntfs/disk_io.c b/libntfs/disk_io.c index 113d36e8..7e665e7d 100644 --- a/libntfs/disk_io.c +++ b/libntfs/disk_io.c @@ -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));