From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 05:03:05 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 053D310656B8; Wed, 8 Feb 2012 05:03:05 +0000 (UTC) (envelope-from wollman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E44298FC08; Wed, 8 Feb 2012 05:03:04 +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 q18534at023278; Wed, 8 Feb 2012 05:03:04 GMT (envelope-from wollman@svn.freebsd.org) Received: (from wollman@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18534fK023276; Wed, 8 Feb 2012 05:03:04 GMT (envelope-from wollman@svn.freebsd.org) Message-Id: <201202080503.q18534fK023276@svn.freebsd.org> From: Garrett Wollman Date: Wed, 8 Feb 2012 05:03:04 +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: r231181 - head/usr.sbin/tzsetup 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: Wed, 08 Feb 2012 05:03:05 -0000 Author: wollman Date: Wed Feb 8 05:03:04 2012 New Revision: 231181 URL: http://svn.freebsd.org/changeset/base/231181 Log: It's not an error if unlink(2) fails because the pathname doesn't exist. Noticed by: kevlo Pointy hat to: wollman Modified: head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Wed Feb 8 04:55:00 2012 (r231180) +++ head/usr.sbin/tzsetup/tzsetup.c Wed Feb 8 05:03:04 2012 (r231181) @@ -723,7 +723,7 @@ install_zoneinfo_file(const char *zonein return (DITEM_FAILURE | DITEM_RECREATE); } - if (unlink(path_localtime) < 0) { + if (unlink(path_localtime) < 0 && errno != ENOENT) { snprintf(prompt, sizeof(prompt), "Could not unlink %s: %s", path_localtime, strerror(errno)); @@ -780,7 +780,7 @@ install_zoneinfo_file(const char *zonein fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } - if (unlink(path_localtime) < 0) { + if (unlink(path_localtime) < 0 && errno != ENOENT) { snprintf(prompt, sizeof(prompt), "Could not unlink %s: %s", path_localtime, strerror(errno));