diff options
Diffstat (limited to 'src/daemon/daemon.c')
-rw-r--r-- | src/daemon/daemon.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c index 8e67173d..7b902322 100644 --- a/src/daemon/daemon.c +++ b/src/daemon/daemon.c | |||
@@ -1147,7 +1147,7 @@ MHD_accept_connection (struct MHD_Daemon *daemon) | |||
1147 | if (MHD_YES == need_fcntl) | 1147 | if (MHD_YES == need_fcntl) |
1148 | { | 1148 | { |
1149 | /* make socket non-inheritable */ | 1149 | /* make socket non-inheritable */ |
1150 | #if WINDOWS | 1150 | #ifdef WINDOWS |
1151 | DWORD dwFlags; | 1151 | DWORD dwFlags; |
1152 | if (!GetHandleInformation ((HANDLE) s, &dwFlags) || | 1152 | if (!GetHandleInformation ((HANDLE) s, &dwFlags) || |
1153 | ((dwFlags != dwFlags & ~HANDLE_FLAG_INHERIT) && | 1153 | ((dwFlags != dwFlags & ~HANDLE_FLAG_INHERIT) && |
@@ -1998,7 +1998,7 @@ create_socket (int domain, int type, int protocol) | |||
1998 | int ctype = SOCK_STREAM | sock_cloexec; | 1998 | int ctype = SOCK_STREAM | sock_cloexec; |
1999 | int fd; | 1999 | int fd; |
2000 | int flags; | 2000 | int flags; |
2001 | #if WINDOWS | 2001 | #ifdef WINDOWS |
2002 | DWORD dwFlags; | 2002 | DWORD dwFlags; |
2003 | #endif | 2003 | #endif |
2004 | 2004 | ||
@@ -2015,19 +2015,19 @@ create_socket (int domain, int type, int protocol) | |||
2015 | if (0 != sock_cloexec) | 2015 | if (0 != sock_cloexec) |
2016 | return fd; /* this is it */ | 2016 | return fd; /* this is it */ |
2017 | /* flag was not set during 'socket' call, let's try setting it manually */ | 2017 | /* flag was not set during 'socket' call, let's try setting it manually */ |
2018 | #if !WINDOWS | 2018 | #ifndef WINDOWS |
2019 | flags = fcntl (fd, F_GETFD); | 2019 | flags = fcntl (fd, F_GETFD); |
2020 | if (flags < 0) | 2020 | if (flags < 0) |
2021 | #else | 2021 | #else |
2022 | if (!GetHandleInformation ((HANDLE) fd, &dwFlags)) | 2022 | if (!GetHandleInformation ((HANDLE) fd, &dwFlags)) |
2023 | #endif | 2023 | #endif |
2024 | { | 2024 | { |
2025 | #if WINDOWS | 2025 | #ifdef WINDOWS |
2026 | SetErrnoFromWinError (GetLastError ()); | 2026 | SetErrnoFromWinError (GetLastError ()); |
2027 | #endif | 2027 | #endif |
2028 | return fd; /* good luck */ | 2028 | return fd; /* good luck */ |
2029 | } | 2029 | } |
2030 | #if !WINDOWS | 2030 | #ifndef WINDOWS |
2031 | if (flags == (flags | FD_CLOEXEC)) | 2031 | if (flags == (flags | FD_CLOEXEC)) |
2032 | return fd; /* already set */ | 2032 | return fd; /* already set */ |
2033 | flags |= FD_CLOEXEC; | 2033 | flags |= FD_CLOEXEC; |
@@ -2038,7 +2038,7 @@ create_socket (int domain, int type, int protocol) | |||
2038 | if (!SetHandleInformation ((HANDLE) fd, HANDLE_FLAG_INHERIT, 0)) | 2038 | if (!SetHandleInformation ((HANDLE) fd, HANDLE_FLAG_INHERIT, 0)) |
2039 | #endif | 2039 | #endif |
2040 | { | 2040 | { |
2041 | #if WINDOWS | 2041 | #ifdef WINDOWS |
2042 | SetErrnoFromWinError (GetLastError ()); | 2042 | SetErrnoFromWinError (GetLastError ()); |
2043 | #endif | 2043 | #endif |
2044 | return fd; /* good luck */ | 2044 | return fd; /* good luck */ |