Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 391f365c authored by Benoit Goby's avatar Benoit Goby
Browse files

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
parent d15715e5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
            }
        }