mirror of
https://github.com/fluencelabs/musl
synced 2025-06-20 18:26:52 +00:00
learned something new - remove is supposed to support directories on POSIX
This commit is contained in:
@ -1,7 +1,9 @@
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user