Fix behavior when removal fails.

This commit is contained in:
Matt Kraai 2000-11-22 01:09:38 +00:00
parent ab8f9e286b
commit 9a71af54f5
2 changed files with 10 additions and 6 deletions

View File

@ -28,14 +28,16 @@
extern int rmdir_main(int argc, char **argv)
{
int status = EXIT_SUCCESS;
if (argc == 1 || **(argv + 1) == '-')
usage(rmdir_usage);
while (--argc > 0) {
if (rmdir(*(++argv)) == -1) {
errorMsg("%s\n", strerror(errno));
exit(FALSE);
perrorMsg("%s", *argv);
status = EXIT_FAILURE;
}
}
return(TRUE);
return status;
}

View File

@ -28,14 +28,16 @@
extern int rmdir_main(int argc, char **argv)
{
int status = EXIT_SUCCESS;
if (argc == 1 || **(argv + 1) == '-')
usage(rmdir_usage);
while (--argc > 0) {
if (rmdir(*(++argv)) == -1) {
errorMsg("%s\n", strerror(errno));
exit(FALSE);
perrorMsg("%s", *argv);
status = EXIT_FAILURE;
}
}
return(TRUE);
return status;
}