>From d437cb98a45566a51e36cf510434d2f3bd27d302 Mon Sep 17 00:00:00 2001
From: Alexpux <[email protected]>
Date: Thu, 18 Dec 2014 10:11:09 +0300
Subject: [PATCH] Fixes for commit "make all file descriptors, opened by
 firebird, close on exec()"

---
 src/common/os/win32/os_utils.cpp | 4 ++--
 src/remote/inet.cpp              | 4 ++--
 src/remote/remote.h              | 2 ++
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/common/os/win32/os_utils.cpp
b/src/common/os/win32/os_utils.cpp
index 7bf995a..948e7ab 100644
--- a/src/common/os/win32/os_utils.cpp
+++ b/src/common/os/win32/os_utils.cpp
@@ -303,9 +303,9 @@ bool isIPv6supported()
  return false;
 }

-int open(const char *pathname, int flags, mode_t mode = 0666)
+int open(const char *pathname, int flags, mode_t mode)
 {
- return ::_open(char *pathname, flags, mode);
+ return ::_open(pathname, flags, mode);
 }

 FILE* fopen(const char *pathname, const char *mode)
diff --git a/src/remote/inet.cpp b/src/remote/inet.cpp
index 8f8ff91..a1d3892 100644
--- a/src/remote/inet.cpp
+++ b/src/remote/inet.cpp
@@ -3086,7 +3086,7 @@ namespace os_utils
 {

 // force socket descriptor to have O_CLOEXEC set
-int socket(int domain, int type, int protocol)
+SOCKET socket(int domain, int type, int protocol)
 {
 #ifdef WIN_NT
  return ::socket(domain, type, protocol);
@@ -3109,7 +3109,7 @@ int socket(int domain, int type, int protocol)
 }

 // force socket descriptor to have O_CLOEXEC set
-int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
+SOCKET accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
 {
 #ifdef WIN_NT
  return ::accept(sockfd, addr, addrlen);
diff --git a/src/remote/remote.h b/src/remote/remote.h
index de1a68d..2501ac7 100644
--- a/src/remote/remote.h
+++ b/src/remote/remote.h
@@ -53,6 +53,8 @@
 #ifndef INVALID_SOCKET
 #define INVALID_SOCKET  -1
 #endif
+#else
+#include <winsock2.h>
 #endif // !WIN_NT

 #if defined(HAVE_ZLIB_H)
-- 
2.2.0
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to