diff options
author | jkh <jkh@FreeBSD.org> | 2004-11-13 04:07:01 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 2004-11-13 04:07:01 +0000 |
commit | 619b5d9b025146f6bbf2334dcdfa9e724751d89e (patch) | |
tree | 2535eda41fad670c39a545d4811dc1b30bcbc87c /bin/rm | |
parent | 39c457059214a40e8db77b3220582a0b47fb2843 (diff) | |
download | FreeBSD-src-619b5d9b025146f6bbf2334dcdfa9e724751d89e.zip FreeBSD-src-619b5d9b025146f6bbf2334dcdfa9e724751d89e.tar.gz |
UNIX conformance: If -r -f on non-existent directory, don't emit error.
Diffstat (limited to 'bin/rm')
-rw-r--r-- | bin/rm/rm.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/rm/rm.c b/bin/rm/rm.c index 52ead50..aefa8c6 100644 --- a/bin/rm/rm.c +++ b/bin/rm/rm.c @@ -192,8 +192,11 @@ rm_tree(char **argv) flags |= FTS_NOSTAT; if (Wflag) flags |= FTS_WHITEOUT; - if (!(fts = fts_open(argv, flags, NULL))) + if (!(fts = fts_open(argv, flags, NULL))) { + if (fflag && errno == ENOENT) + return; err(1, "fts_open"); + } while ((p = fts_read(fts)) != NULL) { switch (p->fts_info) { case FTS_DNR: |