]> sourceware.org Git - newlib-cygwin.git/commitdiff
* syscalls.cc (remove): New function, overriding the newlib
authorCorinna Vinschen <corinna@vinschen.de>
Tue, 19 Dec 2000 20:43:41 +0000 (20:43 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Tue, 19 Dec 2000 20:43:41 +0000 (20:43 +0000)
implementation.

winsup/cygwin/ChangeLog
winsup/cygwin/syscalls.cc

index d0dfabf4cef8207d0138268a9d8f2aebbae96627..8e0a9037cfc8ac3c3f4c264ed718eb75a5f5d98f 100644 (file)
@@ -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
index 103181abf61a03fbeb41104498cf771b3dd8c2d8..1cf7d6284d51dafd99a83455200b258b39945413 100644 (file)
@@ -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 ()
 {
This page took 0.037799 seconds and 5 git commands to generate.