From owner-p4-projects@FreeBSD.ORG Sat Sep 23 09:15:49 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1D20A16A751; Sat, 23 Sep 2006 09:15:49 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C7E9016A721 for ; Sat, 23 Sep 2006 09:15:48 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2989743D66 for ; Sat, 23 Sep 2006 09:15:43 +0000 (GMT) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8N9Fgwp041818 for ; Sat, 23 Sep 2006 09:15:43 GMT (envelope-from rdivacky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8N9Fg0C041815 for perforce@freebsd.org; Sat, 23 Sep 2006 09:15:42 GMT (envelope-from rdivacky@FreeBSD.org) Date: Sat, 23 Sep 2006 09:15:42 GMT Message-Id: <200609230915.k8N9Fg0C041815@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rdivacky@FreeBSD.org using -f From: Roman Divacky To: Perforce Change Reviews Cc: Subject: PERFORCE change 106539 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Sep 2006 09:15:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=106539 Change 106539 by rdivacky@rdivacky_witten on 2006/09/23 09:14:44 Return EISDIR in pread() when arg is a directory. Affected files ... .. //depot/projects/linuxolator/src/sys/compat/linux/linux_file.c#3 edit Differences ... ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_file.c#3 (text+ko) ==== @@ -724,12 +724,28 @@ struct linux_pread_args *uap; { struct pread_args bsd; + struct vnode *vp; + int error; bsd.fd = uap->fd; bsd.buf = uap->buf; bsd.nbyte = uap->nbyte; bsd.offset = uap->offset; - return pread(td, &bsd); + + error = pread(td, &bsd); + + if (error == 0) { + /* This seems to violate POSIX but linux does it */ + if ((error = fgetvp(td, uap->fd, &vp)) != 0) + return (error); + if (vp->v_type == VDIR) { + vrele(vp); + return (EISDIR); + } + vrele(vp); + } + + return (error); } int