bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH gnulib] * lib/accept4.c (accept4): _open_osfhandle() expect a int


From: Marc-André Lureau
Subject: [PATCH gnulib] * lib/accept4.c (accept4): _open_osfhandle() expect a intptr_t. Fix warnings with MinGW64 x64. * lib/fcntl.c (dupfd): Likewise. * lib/w32sock.h: Likewise.
Date: Tue, 24 Jan 2012 03:12:09 +0100

---
 ChangeLog     |    7 +++++++
 lib/accept4.c |    2 +-
 lib/fcntl.c   |    2 +-
 lib/w32sock.h |    2 +-
 4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 81d9557..32fe16a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2012-01-24  Marc-André Lureau  <address@hidden>
 
+       * lib/accept4.c (accept4): _open_osfhandle() expect a
+       intptr_t. Fix warnings with MinGW64 x64.
+       * lib/fcntl.c (dupfd): Likewise.
+       * lib/w32sock.h: Likewise.
+
+2012-01-24  Marc-André Lureau  <address@hidden>
+
        * lib/malloca.c: Use uintptr_t to convert pointers to
        integers. Fix warnings with MinGW64 x64.
 
diff --git a/lib/accept4.c b/lib/accept4.c
index 07dadb0..7163711 100644
--- a/lib/accept4.c
+++ b/lib/accept4.c
@@ -91,7 +91,7 @@ accept4 (int sockfd, struct sockaddr *addr, socklen_t 
*addrlen, int flags)
       /* Closing fd before allocating the new fd ensures that the new fd will
          have the minimum possible value.  */
       close (fd);
-      nfd = _open_osfhandle ((long) new_handle,
+      nfd = _open_osfhandle ((intptr_t) new_handle,
                              O_NOINHERIT | (flags & (O_TEXT | O_BINARY)));
       if (nfd < 0)
         {
diff --git a/lib/fcntl.c b/lib/fcntl.c
index e989d97..3dfb6b7 100644
--- a/lib/fcntl.c
+++ b/lib/fcntl.c
@@ -94,7 +94,7 @@ dupfd (int oldfd, int newfd, int flags)
           result = -1;
           break;
         }
-      duplicated_fd = _open_osfhandle ((long) new_handle, flags);
+      duplicated_fd = _open_osfhandle ((intptr_t) new_handle, flags);
       if (duplicated_fd < 0)
         {
           CloseHandle (new_handle);
diff --git a/lib/w32sock.h b/lib/w32sock.h
index 846c342..9e38a7b 100644
--- a/lib/w32sock.h
+++ b/lib/w32sock.h
@@ -29,7 +29,7 @@
 #include "msvc-nothrow.h"
 
 #define FD_TO_SOCKET(fd)   ((SOCKET) _get_osfhandle ((fd)))
-#define SOCKET_TO_FD(fh)   (_open_osfhandle ((long) (fh), O_RDWR | O_BINARY))
+#define SOCKET_TO_FD(fh)   (_open_osfhandle ((intptr_t) (fh), O_RDWR | 
O_BINARY))
 
 static inline void
 set_winsock_errno (void)
-- 
1.7.7.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]