From owner-svn-src-stable-10@FreeBSD.ORG Fri Nov 14 10:56:33 2014 Return-Path: <owner-svn-src-stable-10@FreeBSD.ORG> Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3155386; Fri, 14 Nov 2014 10:56:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9ED5D362; Fri, 14 Nov 2014 10:56:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAEAuXMq067443; Fri, 14 Nov 2014 10:56:33 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAEAuXit067442; Fri, 14 Nov 2014 10:56:33 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411141056.sAEAuXit067442@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala <trasz@FreeBSD.org> Date: Fri, 14 Nov 2014 10:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274500 - stable/10/usr.sbin/autofs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree <svn-src-stable-10.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-stable-10>, <mailto:svn-src-stable-10-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/svn-src-stable-10/> List-Post: <mailto:svn-src-stable-10@freebsd.org> List-Help: <mailto:svn-src-stable-10-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10>, <mailto:svn-src-stable-10-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 14 Nov 2014 10:56:33 -0000 Author: trasz Date: Fri Nov 14 10:56:33 2014 New Revision: 274500 URL: https://svnweb.freebsd.org/changeset/base/274500 Log: MFC r272717: Remove call to access(2) which didn't serve any purpose, and make it more tolerant to errors. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/autofs/common.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/common.c ============================================================================== --- stable/10/usr.sbin/autofs/common.c Fri Nov 14 10:53:55 2014 (r274499) +++ stable/10/usr.sbin/autofs/common.c Fri Nov 14 10:56:33 2014 (r274500) @@ -169,17 +169,12 @@ create_directory(const char *path) if (component == NULL) break; concat(&partial, &component); - //log_debugx("checking \"%s\" for existence", partial); - error = access(partial, F_OK); - if (error == 0) - continue; - if (errno != ENOENT) - log_err(1, "cannot access %s", partial); - log_debugx("directory %s does not exist, creating", - partial); + //log_debugx("creating \"%s\"", partial); error = mkdir(partial, 0755); - if (error != 0) - log_err(1, "cannot create %s", partial); + if (error != 0 && errno != EEXIST) { + log_warn("cannot create %s", partial); + return; + } } free(tofree);