From nobody Sat May 11 19:16:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcFpq72tCz5KddC; Sat, 11 May 2024 19:16:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VcFpq66G0z4RQ3; Sat, 11 May 2024 19:16:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715454979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y3GWuoJ6QYs8lHLrAr7dAGzIIVGef0zRv08QxbGbsNk=; b=NL9Wcan1xgRJPDw6cqkgGj+RsskrQh7WtQml+8gKwcsBDP930c0jOIThhfQA7xfcKYiw9h ACflnNV5opQwiiXjfGu2JeUFWU1ofRrm/1a7o7Xpt3l0hvNIqgU0RcPecFNKojzDJbd+b6 jj7Byco8G3Pw4oWge+yor/WGDnCEEwASwSeUGj3hTcKNpFmZKnL6VWoJEFdXXWtrx/tD4q ZjQ9EhN/N49PmS7nmwPpAPubAC0QjXoEIUvTqTcfxKQXkoQhvEXWOyYI6B0+ZnxpNVwtRz s7ayCMN6YtzLsovSmT3aOXPAtcCiNoFu5Z7eymZ1GCv/OxX+09ZTpqoUWN7urQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715454979; a=rsa-sha256; cv=none; b=yl9KvaKU69K+SmzvPRYiaH5tkRC/mRrTpj/XgoSaf5s+La7jry1lFS00nMUbTlz5HL2Za1 pxGyFFGhYccyjTJRGXiCOm2RNytrwaSPbHzRiDlGT+EzRZ7BXCFKvqk9M65MbIOt6XCYP8 N5K7wBTF9EEbAknR8Iz12ThXuYhAydGvEIG4Pmgh8tzXbDVlQKP6ye8pxJc1kfFvrOD7vb mNtWbEhcf2Z4H8VO5kipabg/mNmV85R6OTvcFcSty29w/mviMktc7b5cktA7JkjDRlWe5G gk+lpqSNuWwcEFPqffGLRVDICRGlg6Y8mue1XpZ4KUijsQWYXHB8cJWcLcR1yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715454979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y3GWuoJ6QYs8lHLrAr7dAGzIIVGef0zRv08QxbGbsNk=; b=bvJktWthQdsd2Ngp8Jj+mdAB54bq9IhWt/ul619s454hHGTRloK3tlOs1fuz3KEYWzOxAH 6Yk8M6hyI0kH5AypAZDVLFPhfy6WeJ0lKZUPNSneI3kBc34Cm3lf6KUgxc2qQs0aNFOC9N VnliwzH2vEJWre9XCDjK1Pk+EQtrvgIf9JZuIl9+UlwIvYNShWDocXMOpnEAjShsTEeZx1 zhhgxB1+K1YOQR15ofLHexxKjvBGXSJcodYww6cPlDEZ1qDStXGtDg4v/mILU7OzkWfvVr +GuoF/eWRFfS5/Ub5znbl0MFrbHy+IYzeGaS7C7tTnDPWsEkWLKpkMZGWtRzJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VcFpq5bPTzY8j; Sat, 11 May 2024 19:16:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44BJGJJO010962; Sat, 11 May 2024 19:16:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44BJGJ2I010959; Sat, 11 May 2024 19:16:19 GMT (envelope-from git) Date: Sat, 11 May 2024 19:16:19 GMT Message-Id: <202405111916.44BJGJ2I010959@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 9bcc1b18c119 - main - /bin/rmdir: Exit with status 2 for invalid arguments List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9bcc1b18c119148e4455e548c90b2bc9cef16d1b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9bcc1b18c119148e4455e548c90b2bc9cef16d1b commit 9bcc1b18c119148e4455e548c90b2bc9cef16d1b Author: Henrich Hartzer AuthorDate: 2024-05-10 17:53:49 +0000 Commit: Warner Losh CommitDate: 2024-05-11 19:13:28 +0000 /bin/rmdir: Exit with status 2 for invalid arguments PR: 277677 Signed-off-by: Henrich Hartzer Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1161 --- bin/rmdir/rmdir.1 | 15 ++++++++------- bin/rmdir/rmdir.c | 2 +- bin/rmdir/tests/rmdir_test.sh | 6 +++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/bin/rmdir/rmdir.1 b/bin/rmdir/rmdir.1 index 87ca1f1547f0..eb23c605050c 100644 --- a/bin/rmdir/rmdir.1 +++ b/bin/rmdir/rmdir.1 @@ -74,14 +74,14 @@ The .Nm utility exits with one of the following values: .Bl -tag -width indent -.It Li 0 -Each directory entry specified by a +.It Er 0 +Each .Ar directory -operand -referred to an empty directory and was removed -successfully. -.It Li >0 -An error occurred. +referred to an empty directory and was removed successfully. +.It Er 1 +An error occurred while attempting to remove one or more directories. +.It Er 2 +Invalid arguments. .El .Sh EXAMPLES Remove the directory @@ -97,6 +97,7 @@ stopping at the first non-empty directory (if any): .Dl $ rmdir -p cow/horse/monkey .Sh SEE ALSO .Xr rm 1 +.Xr rmdir 2 .Sh STANDARDS The .Nm diff --git a/bin/rmdir/rmdir.c b/bin/rmdir/rmdir.c index c5d3db831309..0a495018495c 100644 --- a/bin/rmdir/rmdir.c +++ b/bin/rmdir/rmdir.c @@ -112,5 +112,5 @@ usage(void) { (void)fprintf(stderr, "usage: rmdir [-pv] directory ...\n"); - exit(1); + exit(2); } diff --git a/bin/rmdir/tests/rmdir_test.sh b/bin/rmdir/tests/rmdir_test.sh index d443849258b6..ba80ac6204be 100644 --- a/bin/rmdir/tests/rmdir_test.sh +++ b/bin/rmdir/tests/rmdir_test.sh @@ -35,8 +35,8 @@ invalid_usage_head() invalid_usage_body() { - atf_check -s not-exit:0 -e match:"$usage_output" rmdir -p - atf_check -s not-exit:0 -e match:"$usage_output" rmdir -v + atf_check -s exit:2 -e match:"$usage_output" rmdir -p + atf_check -s exit:2 -e match:"$usage_output" rmdir -v } atf_test_case no_arguments @@ -47,7 +47,7 @@ no_arguments_head() no_arguments_body() { - atf_check -s not-exit:0 -e match:"$usage_output" rmdir + atf_check -s exit:2 -e match:"$usage_output" rmdir } atf_init_test_cases()