From owner-svn-src-all@FreeBSD.ORG Fri Jan 20 07:29:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3E5B1065674; Fri, 20 Jan 2012 07:29:29 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 932C38FC0C; Fri, 20 Jan 2012 07:29:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K7TTiC029563; Fri, 20 Jan 2012 07:29:29 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K7TT6E029561; Fri, 20 Jan 2012 07:29:29 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201201200729.q0K7TT6E029561@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 20 Jan 2012 07:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230372 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 07:29:29 -0000 Author: jh Date: Fri Jan 20 07:29:29 2012 New Revision: 230372 URL: http://svn.freebsd.org/changeset/base/230372 Log: - Clean up checkpath(). - Remove unneeded sysexits.h include. No functional change. Submitted by: bde Modified: head/sbin/mount/getmntopts.c Modified: head/sbin/mount/getmntopts.c ============================================================================== --- head/sbin/mount/getmntopts.c Fri Jan 20 07:02:42 2012 (r230371) +++ head/sbin/mount/getmntopts.c Fri Jan 20 07:29:29 2012 (r230372) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "mntopts.h" @@ -129,14 +128,12 @@ checkpath(const char *path, char *resolv { struct stat sb; - if (realpath(path, resolved) != NULL && stat(resolved, &sb) == 0) { - if (!S_ISDIR(sb.st_mode)) { - errno = ENOTDIR; - return (1); - } - } else + if (realpath(path, resolved) == NULL || stat(resolved, &sb) != 0) return (1); - + if (!S_ISDIR(sb.st_mode)) { + errno = ENOTDIR; + return (1); + } return (0); }