patch-2.1.71 linux/fs/locks.c

Next file: linux/fs/nfs/dir.c
Previous file: linux/fs/isofs/namei.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.70/linux/fs/locks.c linux/fs/locks.c
@@ -402,11 +402,11 @@
 	
 	switch (flock.l_type) {
 	case F_RDLCK:
-		if (!(filp->f_mode & 1))
+		if (!(filp->f_mode & FMODE_READ))
 			return (-EBADF);
 		break;
 	case F_WRLCK:
-		if (!(filp->f_mode & 2))
+		if (!(filp->f_mode & FMODE_WRITE))
 			return (-EBADF);
 		break;
 	case F_UNLCK:

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov