X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=fs%2Flocks.c;h=20457486d6b2a95e67783f220b89f8cb19e22d3e;hb=3856d30ded1fe43c6657927ebad402d25cd128f4;hp=5eb259e3cd38431e7e52baa5ed6975307ff782b5;hpb=a048d3aff8b828b6c0fa7ddd90a531248ab4e0f9;p=linux-2.6-omap-h63xx.git diff --git a/fs/locks.c b/fs/locks.c index 5eb259e3cd3..20457486d6b 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -1580,7 +1580,8 @@ asmlinkage long sys_flock(unsigned int fd, unsigned int cmd) cmd &= ~LOCK_NB; unlock = (cmd == LOCK_UN); - if (!unlock && !(cmd & LOCK_MAND) && !(filp->f_mode & 3)) + if (!unlock && !(cmd & LOCK_MAND) && + !(filp->f_mode & (FMODE_READ|FMODE_WRITE))) goto out_putf; error = flock_make_lock(filp, &lock, cmd);