From owner-svn-src-head@FreeBSD.ORG Mon Jan 3 17:17:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02BD8106566B; Mon, 3 Jan 2011 17:17:32 +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 E63C38FC08; Mon, 3 Jan 2011 17:17:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p03HHVMP099588; Mon, 3 Jan 2011 17:17:31 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p03HHVUC099586; Mon, 3 Jan 2011 17:17:31 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201101031717.p03HHVUC099586@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 3 Jan 2011 17:17:31 +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: r216922 - head/bin/setfacl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2011 17:17:32 -0000 Author: jh Date: Mon Jan 3 17:17:31 2011 New Revision: 216922 URL: http://svn.freebsd.org/changeset/base/216922 Log: Increase carried_error if we skip a file due to an error. This ensures that setfacl(1) exits with proper exit status on failure. PR: bin/149780 Submitted by: Ævar Arnfjörð Bjarmason (original version) Reviewed by: trasz MFC after: 3 weeks Modified: head/bin/setfacl/setfacl.c Modified: head/bin/setfacl/setfacl.c ============================================================================== --- head/bin/setfacl/setfacl.c Mon Jan 3 16:29:00 2011 (r216921) +++ head/bin/setfacl/setfacl.c Mon Jan 3 17:17:31 2011 (r216922) @@ -201,12 +201,14 @@ main(int argc, char *argv[]) if (stat(file->filename, &sb) == -1) { warn("%s: stat() failed", file->filename); + carried_error++; continue; } if (acl_type == ACL_TYPE_DEFAULT && S_ISDIR(sb.st_mode) == 0) { warnx("%s: default ACL may only be set on a directory", file->filename); + carried_error++; continue; } @@ -218,6 +220,7 @@ main(int argc, char *argv[]) if (acl_type == ACL_TYPE_DEFAULT) { warnx("%s: there are no default entries " "in NFSv4 ACLs", file->filename); + carried_error++; continue; } acl_type = ACL_TYPE_NFS4; @@ -240,6 +243,7 @@ main(int argc, char *argv[]) else warn("%s: acl_get_file() failed", file->filename); + carried_error++; continue; }