[newlib-cygwin/main] Cygwin: unlink_nt: declare in winsup.h

Corinna Vinschen corinna@sourceware.org
Fri Sep 8 20:41:41 GMT 2023


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=53472e1803808d5fb91029f4c26c86989c62c82c

commit 53472e1803808d5fb91029f4c26c86989c62c82c
Author:     Corinna Vinschen <corinna@vinschen.de>
AuthorDate: Fri Sep 8 22:34:52 2023 +0200
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Fri Sep 8 22:34:52 2023 +0200

    Cygwin: unlink_nt: declare in winsup.h
    
    unlink_nt is used more than once so declare it in a header.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/fhandler/disk_file.cc   | 2 --
 winsup/cygwin/forkable.cc             | 4 ----
 winsup/cygwin/local_includes/winsup.h | 2 ++
 3 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/winsup/cygwin/fhandler/disk_file.cc b/winsup/cygwin/fhandler/disk_file.cc
index 94f7ef566756..d59cde78b5bd 100644
--- a/winsup/cygwin/fhandler/disk_file.cc
+++ b/winsup/cygwin/fhandler/disk_file.cc
@@ -1842,8 +1842,6 @@ fhandler_disk_file::mkdir (mode_t mode)
 int
 fhandler_disk_file::rmdir ()
 {
-  extern NTSTATUS unlink_nt (path_conv &pc, bool sharable);
-
   if (!pc.isdir ())
     {
       set_errno (ENOTDIR);
diff --git a/winsup/cygwin/forkable.cc b/winsup/cygwin/forkable.cc
index c69c8bea9e98..cd317a1ae09e 100644
--- a/winsup/cygwin/forkable.cc
+++ b/winsup/cygwin/forkable.cc
@@ -27,10 +27,6 @@ details. */
 #include <assert.h>
 #include <tls_pbuf.h>
 
-/* Allow concurrent processes to use the same dll or exe
- * via their hardlink while we delete our hardlink. */
-extern NTSTATUS unlink_nt (path_conv &pc, bool sharable);
-
 #define MUTEXSEP L"@"
 #define PATHSEP L"\\"
 
diff --git a/winsup/cygwin/local_includes/winsup.h b/winsup/cygwin/local_includes/winsup.h
index c9788de8f012..bf0a0bcc3fc0 100644
--- a/winsup/cygwin/local_includes/winsup.h
+++ b/winsup/cygwin/local_includes/winsup.h
@@ -225,6 +225,8 @@ class path_conv;
 
 int stat_worker (path_conv &pc, struct stat *buf);
 
+NTSTATUS unlink_nt (path_conv &pc, bool sharable);
+
 ino_t readdir_get_ino (const char *path, bool dot_dot);
 
 /* mmap functions. */


More information about the Cygwin-cvs mailing list