Date: Tue, 1 Feb 2011 16:11:31 +0000 (UTC) From: Jaakko Heinonen <jh@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r218172 - stable/8/bin/setfacl Message-ID: <201102011611.p11GBVIL077654@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jh Date: Tue Feb 1 16:11:31 2011 New Revision: 218172 URL: http://svn.freebsd.org/changeset/base/218172 Log: MFC r216922: 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 Modified: stable/8/bin/setfacl/setfacl.c Directory Properties: stable/8/bin/setfacl/ (props changed) Modified: stable/8/bin/setfacl/setfacl.c ============================================================================== --- stable/8/bin/setfacl/setfacl.c Tue Feb 1 15:48:27 2011 (r218171) +++ stable/8/bin/setfacl/setfacl.c Tue Feb 1 16:11:31 2011 (r218172) @@ -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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102011611.p11GBVIL077654>