use sys call
[unix-history] / usr / src / bin / rmdir / rmdir.c
CommitLineData
a645d56b 1static char *sccsid = "@(#)rmdir.c 4.6 (Berkeley) %G%";
ff487e30
BJ
2/*
3 * Remove directory
4 */
ff487e30
BJ
5#include <stdio.h>
6
ff487e30 7main(argc,argv)
a645d56b
SL
8 int argc;
9 char **argv;
ff487e30 10{
a645d56b 11 int errors = 0;
ff487e30 12
a645d56b 13 if (argc < 2) {
ff487e30
BJ
14 fprintf(stderr, "rmdir: arg count\n");
15 exit(1);
16 }
a645d56b
SL
17 while (--argc)
18 if (rmdir(*++argv) < 0) {
19 perror(*argv);;
20 errors++;
21 }
22 exit(errors != 0);
ff487e30 23}