diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index b3a110aaa..4cc8d07f5 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -1161,24 +1161,15 @@ _remove_r (struct _reent *, const char *ourname) return -1; } - return win32_name.isdir () ? rmdir (ourname) : unlink (ourname); + int res = win32_name.isdir () ? rmdir (ourname) : unlink (ourname); + syscall_printf ("%R = remove(%s)", res, ourname); + return res; } extern "C" int remove (const char *ourname) { - path_conv win32_name (ourname, PC_SYM_NOFOLLOW); - - if (win32_name.error) - { - set_errno (win32_name.error); - syscall_printf ("-1 = remove (%s)", ourname); - return -1; - } - - int res = win32_name.isdir () ? rmdir (ourname) : unlink (ourname); - syscall_printf ("%R = remove(%s)", res, ourname); - return res; + return _remove_r (_REENT, ourname); } extern "C" pid_t