aboutsummaryrefslogtreecommitdiff
path: root/bin/rmdir
diff options
context:
space:
mode:
Diffstat (limited to 'bin/rmdir')
-rw-r--r--bin/rmdir/Makefile3
-rw-r--r--bin/rmdir/Makefile.depend2
-rw-r--r--bin/rmdir/rmdir.120
-rw-r--r--bin/rmdir/rmdir.c18
-rw-r--r--bin/rmdir/tests/Makefile2
-rw-r--r--bin/rmdir/tests/Makefile.depend1
-rw-r--r--bin/rmdir/tests/rmdir_test.sh7
7 files changed, 14 insertions, 39 deletions
diff --git a/bin/rmdir/Makefile b/bin/rmdir/Makefile
index 9a081323f813..c51640af3b6f 100644
--- a/bin/rmdir/Makefile
+++ b/bin/rmdir/Makefile
@@ -1,6 +1,3 @@
-# @(#)Makefile 8.1 (Berkeley) 5/31/93
-# $FreeBSD$
-
.include <src.opts.mk>
PACKAGE=runtime
diff --git a/bin/rmdir/Makefile.depend b/bin/rmdir/Makefile.depend
index 6cfaab1c3644..6ef78fac5cbf 100644
--- a/bin/rmdir/Makefile.depend
+++ b/bin/rmdir/Makefile.depend
@@ -1,8 +1,6 @@
-# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- gnu/lib/csu \
include \
include/xlocale \
lib/${CSU_DIR} \
diff --git a/bin/rmdir/rmdir.1 b/bin/rmdir/rmdir.1
index f71f4bb404f4..b43328110960 100644
--- a/bin/rmdir/rmdir.1
+++ b/bin/rmdir/rmdir.1
@@ -29,9 +29,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)rmdir.1 8.1 (Berkeley) 5/31/93
-.\" $FreeBSD$
-.\"
.Dd March 15, 2013
.Dt RMDIR 1
.Os
@@ -77,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
@@ -99,7 +96,8 @@ stopping at the first non-empty directory (if any):
.Pp
.Dl $ rmdir -p cow/horse/monkey
.Sh SEE ALSO
-.Xr rm 1
+.Xr rm 1 ,
+.Xr rmdir 2
.Sh STANDARDS
The
.Nm
diff --git a/bin/rmdir/rmdir.c b/bin/rmdir/rmdir.c
index 22f1141e14ec..0a495018495c 100644
--- a/bin/rmdir/rmdir.c
+++ b/bin/rmdir/rmdir.c
@@ -29,20 +29,6 @@
* SUCH DAMAGE.
*/
-#if 0
-#ifndef lint
-static char const copyright[] =
-"@(#) Copyright (c) 1992, 1993, 1994\n\
- The Regents of the University of California. All rights reserved.\n";
-#endif /* not lint */
-
-#ifndef lint
-static char sccsid[] = "@(#)rmdir.c 8.3 (Berkeley) 4/2/94";
-#endif /* not lint */
-#endif
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
@@ -50,7 +36,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
static int rm_path(char *);
-static void usage(void);
+static void usage(void) __dead2;
static int pflag;
static int vflag;
@@ -126,5 +112,5 @@ usage(void)
{
(void)fprintf(stderr, "usage: rmdir [-pv] directory ...\n");
- exit(1);
+ exit(2);
}
diff --git a/bin/rmdir/tests/Makefile b/bin/rmdir/tests/Makefile
index abf3a1e02a37..00c885b2949b 100644
--- a/bin/rmdir/tests/Makefile
+++ b/bin/rmdir/tests/Makefile
@@ -1,5 +1,3 @@
-# $FreeBSD$
-
ATF_TESTS_SH+= rmdir_test
.include <bsd.test.mk>
diff --git a/bin/rmdir/tests/Makefile.depend b/bin/rmdir/tests/Makefile.depend
index f80275d86ab1..11aba52f82cf 100644
--- a/bin/rmdir/tests/Makefile.depend
+++ b/bin/rmdir/tests/Makefile.depend
@@ -1,4 +1,3 @@
-# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/rmdir/tests/rmdir_test.sh b/bin/rmdir/tests/rmdir_test.sh
index 204039c28311..ba80ac6204be 100644
--- a/bin/rmdir/tests/rmdir_test.sh
+++ b/bin/rmdir/tests/rmdir_test.sh
@@ -23,7 +23,6 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $FreeBSD$
#
usage_output='usage: rmdir'
@@ -36,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
@@ -48,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()