diff --git a/src/stdio/remove.c b/src/stdio/remove.c index fc12f7c1..e147ba25 100644 --- a/src/stdio/remove.c +++ b/src/stdio/remove.c @@ -4,6 +4,6 @@ int remove(const char *path) { - return (syscall(SYS_unlink, path) && errno == EISDIR) - ? syscall(SYS_rmdir, path) : 0; + int r = syscall(SYS_unlink, path); + return (r && errno == EISDIR) ? syscall(SYS_rmdir, path) : r; }