|
@@ -1,7 +1,9 @@
|
|
#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;
|
|
}
|
|
}
|