From: Thomas Veerman Date: Mon, 22 Aug 2011 11:46:58 +0000 (+0000) Subject: Allow block special files to be file locked X-Git-Tag: v3.2.0~341 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/style.css?a=commitdiff_plain;h=55d926cbaa93387ae31d87b2d64612ddbe46735a;p=minix.git Allow block special files to be file locked --- diff --git a/servers/avfs/lock.c b/servers/avfs/lock.c index 8b459e91f..58eddb077 100644 --- a/servers/avfs/lock.c +++ b/servers/avfs/lock.c @@ -43,7 +43,8 @@ int req; /* either F_SETLK or F_SETLKW */ mo = f->filp_mode; if (ltype != F_UNLCK && ltype != F_RDLCK && ltype != F_WRLCK) return(EINVAL); if (req == F_GETLK && ltype == F_UNLCK) return(EINVAL); - if ( (f->filp_vno->v_mode & I_TYPE) != I_REGULAR) return(EINVAL); + if ( (f->filp_vno->v_mode & I_TYPE) != I_REGULAR && + (f->filp_vno->v_mode & I_TYPE) != I_BLOCK_SPECIAL) return(EINVAL); if (req != F_GETLK && ltype == F_RDLCK && (mo & R_BIT) == 0) return(EBADF); if (req != F_GETLK && ltype == F_WRLCK && (mo & W_BIT) == 0) return(EBADF);