]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl_setup: provide the shutdown flags wider
authorDaniel Stenberg <daniel@haxx.se>
Tue, 20 Apr 2021 07:21:09 +0000 (09:21 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 21 Apr 2021 07:24:46 +0000 (09:24 +0200)
By using #ifdef on the symbol names to work on anything that don't
provide them. SCO OpenServer 5.0.7, sys/socket.h does not define either
SHUT_RDWR, SHUT_RD, and SHUT_WR.

Reported-by: Kevin R. Bulgrien
Bug: https://curl.se/mail/lib-2021-04/0073.html
Closes #6925

lib/curl_setup.h

index cf1c26a14e398dc9175c5b8bfd77b990bafdc2d4..b63b9e2d73a79e9c9d0a075a8d41800fb3368cb2 100644 (file)
@@ -715,13 +715,19 @@ int netware_init(void);
 #endif
 
 /*
- * Portable symbolic names for Winsock shutdown() mode flags.
+ * shutdown() flags for systems that don't define them
  */
 
-#ifdef USE_WINSOCK
-#  define SHUT_RD   0x00
-#  define SHUT_WR   0x01
-#  define SHUT_RDWR 0x02
+#ifndef SHUT_RD
+#define SHUT_RD 0x00
+#endif
+
+#ifndef SHUT_WR
+#define SHUT_WR 0x01
+#endif
+
+#ifndef SHUT_RDWR
+#define SHUT_RDWR 0x02
 #endif
 
 /* Define S_ISREG if not defined by system headers, f.e. MSVC */