This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] Cygwin: drop CYGWIN_SOCKET_UUID, define CYGWIN_SOCKET_GUID as GUID pointer


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

commit 1949db782917f6703da736f9f15665ca7e5d6e0d
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Fri Mar 2 18:07:39 2018 +0100

    Cygwin: drop CYGWIN_SOCKET_UUID, define CYGWIN_SOCKET_GUID as GUID pointer
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/fhandler_socket_unix.cc | 8 ++++++++
 winsup/cygwin/ntdll.h                 | 5 +++--
 winsup/cygwin/path.cc                 | 5 +----
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/winsup/cygwin/fhandler_socket_unix.cc b/winsup/cygwin/fhandler_socket_unix.cc
index 506befc..ee43b1f 100644
--- a/winsup/cygwin/fhandler_socket_unix.cc
+++ b/winsup/cygwin/fhandler_socket_unix.cc
@@ -34,6 +34,14 @@ static int __unused
 get_inet_addr_unix (const struct sockaddr *in, int inlen,
 		    struct sockaddr_storage *out, int *outlen,
 		    int *type = NULL)
+GUID __cygwin_socket_guid = {
+  .Data1 = 0xefc1714d,
+  .Data2 = 0x7b19,
+  .Data3 = 0x4407,
+  .Data4 = { 0xba, 0xb3, 0xc5, 0xb1, 0xf9, 0x2c, 0xb8, 0x8c }
+};
+
+HANDLE
 {
   /* Check for abstract socket. */
   if (inlen >= (int) sizeof (in->sa_family) + 7
diff --git a/winsup/cygwin/ntdll.h b/winsup/cygwin/ntdll.h
index 68c359e..c89591f 100644
--- a/winsup/cygwin/ntdll.h
+++ b/winsup/cygwin/ntdll.h
@@ -10,9 +10,10 @@
 
 #include <w32api/ntstatus.h>
 
-/* Special values for Cygwin AF_UNIX socket reparse points. */
+/* Values for Cygwin AF_UNIX socket reparse points. */
 #define IO_REPARSE_TAG_CYGUNIX	(0x00006375)
-#define CYGWIN_SOCKET_UUID	L"efc1714d-7b19-4407-bab3-c5b1f92cb88c"
+extern GUID __cygwin_socket_guid;
+#define CYGWIN_SOCKET_GUID (&__cygwin_socket_guid)
 
 /* custom status code: */
 #define STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION ((NTSTATUS) 0xe0000269)
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index f608257..a132a0a 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -65,7 +65,6 @@
 #include "shared_info.h"
 #include "tls_pbuf.h"
 #include "environ.h"
-#include "uuid.h"
 #undef basename
 
 suffix_info stat_suffixes[] =
@@ -2356,10 +2355,8 @@ check_reparse_point_target (HANDLE h, bool remote, PREPARSE_DATA_BUFFER rp,
   else if (rp->ReparseTag == IO_REPARSE_TAG_CYGUNIX)
     {
       PREPARSE_GUID_DATA_BUFFER rgp = (PREPARSE_GUID_DATA_BUFFER) rp;
-      UUID uuid;
 
-      uuid_from_string (CYGWIN_SOCKET_UUID, uuid);
-      if (memcmp (&uuid, &rgp->ReparseGuid, sizeof (UUID)) == 0)
+      if (memcmp (CYGWIN_SOCKET_GUID, &rgp->ReparseGuid, sizeof (GUID)) == 0)
 	return PATH_SOCKET | PATH_REP;
     }
   return 0;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]