diff options
| -rw-r--r-- | coreutils/rm.c | 5 | ||||
| -rw-r--r-- | rm.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/coreutils/rm.c b/coreutils/rm.c index 275c05946..c93a94ce1 100644 --- a/coreutils/rm.c +++ b/coreutils/rm.c | |||
| @@ -45,6 +45,11 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk) | |||
| 45 | 45 | ||
| 46 | static int dirAction(const char *fileName, struct stat *statbuf, void* junk) | 46 | static int dirAction(const char *fileName, struct stat *statbuf, void* junk) |
| 47 | { | 47 | { |
| 48 | if (recursiveFlag == FALSE) { | ||
| 49 | errno = EISDIR; | ||
| 50 | perror(fileName); | ||
| 51 | return (FALSE); | ||
| 52 | } | ||
| 48 | if (rmdir(fileName) < 0) { | 53 | if (rmdir(fileName) < 0) { |
| 49 | perror(fileName); | 54 | perror(fileName); |
| 50 | return (FALSE); | 55 | return (FALSE); |
| @@ -45,6 +45,11 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk) | |||
| 45 | 45 | ||
| 46 | static int dirAction(const char *fileName, struct stat *statbuf, void* junk) | 46 | static int dirAction(const char *fileName, struct stat *statbuf, void* junk) |
| 47 | { | 47 | { |
| 48 | if (recursiveFlag == FALSE) { | ||
| 49 | errno = EISDIR; | ||
| 50 | perror(fileName); | ||
| 51 | return (FALSE); | ||
| 52 | } | ||
| 48 | if (rmdir(fileName) < 0) { | 53 | if (rmdir(fileName) < 0) { |
| 49 | perror(fileName); | 54 | perror(fileName); |
| 50 | return (FALSE); | 55 | return (FALSE); |
