提交 9646e4d0 编写于 作者: R Rich Felker

fix messed-up errno if remove fails for a non-EISDIR reason

上级 0b240ccf
......@@ -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;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册