提交 0b240ccf 编写于 作者: R Rich Felker

learned something new - remove is supposed to support directories on POSIX

上级 4106cdcd
#include <stdio.h> #include <stdio.h>
#include <errno.h>
#include "syscall.h" #include "syscall.h"
int remove(const char *path) int remove(const char *path)
{ {
return syscall(SYS_unlink, path); return (syscall(SYS_unlink, path) && errno == EISDIR)
? syscall(SYS_rmdir, path) : 0;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册