From 0b240ccf523b9af23dd1efa78274f397fcc90cdd Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 29 Mar 2011 08:24:28 -0400 Subject: learned something new - remove is supposed to support directories on POSIX --- src/stdio/remove.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/stdio/remove.c b/src/stdio/remove.c index 9e1de7f2..fc12f7c1 100644 --- a/src/stdio/remove.c +++ b/src/stdio/remove.c @@ -1,7 +1,9 @@ #include +#include #include "syscall.h" int remove(const char *path) { - return syscall(SYS_unlink, path); + return (syscall(SYS_unlink, path) && errno == EISDIR) + ? syscall(SYS_rmdir, path) : 0; } -- cgit v1.2.1