diff options
author | Benoit Goby <benoit@android.com> | 2013-01-15 18:43:01 -0800 |
---|---|---|
committer | Benoit Goby <benoit@android.com> | 2013-03-25 19:59:21 -0700 |
commit | 391f365c6d64d3223adc4cbd6b2fb558416ccceb (patch) | |
tree | 19a83f8fee64eee76cfcca444b6a8b003f557e59 /toolbox/rm.c | |
parent | d15715e5a085dc052ab462799950622f844b0059 (diff) | |
download | core-391f365c6d64d3223adc4cbd6b2fb558416ccceb.tar.gz core-391f365c6d64d3223adc4cbd6b2fb558416ccceb.tar.bz2 core-391f365c6d64d3223adc4cbd6b2fb558416ccceb.zip |
toolbox: Fix rm -f with multiple files
Only check errno if unlink returns -1.
Continue instead of exiting if one file does not exist.
Change-Id: Iaf01b8523b84e87fcb0d732b89b7be6e24279c0b
Diffstat (limited to 'toolbox/rm.c')
-rw-r--r-- | toolbox/rm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/toolbox/rm.c b/toolbox/rm.c index 3a24becb6..127cbc450 100644 --- a/toolbox/rm.c +++ b/toolbox/rm.c @@ -103,8 +103,8 @@ int rm_main(int argc, char *argv[]) ret = unlink_recursive(argv[i], flags); } else { ret = unlink(argv[i]); - if (errno == ENOENT && (flags & OPT_FORCE)) { - return 0; + if (ret < 0 && errno == ENOENT && (flags & OPT_FORCE)) { + continue; } } |