* syscalls.cc (remove): New function, overriding the newlib
implementation.
This commit is contained in:
parent
602f8b5aba
commit
3112d7a41c
|
@ -1,3 +1,8 @@
|
|||
Tue Dec 19 21:39:00 2000 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* syscalls.cc (remove): New function, overriding the newlib
|
||||
implementation.
|
||||
|
||||
Tue Dec 19 16:26:00 2000 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* environ.cc (struct parse_thing): Add entry for new CYGWIN option
|
||||
|
|
|
@ -166,6 +166,25 @@ done:
|
|||
return res;
|
||||
}
|
||||
|
||||
extern "C" int
|
||||
remove (const char *ourname)
|
||||
{
|
||||
path_conv win32_name (ourname, PC_SYM_NOFOLLOW | PC_FULL);
|
||||
|
||||
if (win32_name.error)
|
||||
{
|
||||
set_errno (win32_name.error);
|
||||
syscall_printf ("-1 = remove (%s)", ourname);
|
||||
return -1;
|
||||
}
|
||||
|
||||
DWORD atts = win32_name.file_attributes ();
|
||||
if (atts != 0xffffffff && atts & FILE_ATTRIBUTE_DIRECTORY)
|
||||
return rmdir (ourname);
|
||||
|
||||
return _unlink (ourname);
|
||||
}
|
||||
|
||||
extern "C" pid_t
|
||||
_getpid ()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue