[openssl-commits] [openssl] master update

Richard Levitte levitte at openssl.org
Fri Aug 25 21:59:35 UTC 2017


The branch master has been updated
       via  384cdd46a1184ae33c2fe76ad49f87b0c02d078a (commit)
       via  9a5d80cb5e44aa0908f4b10e5fca1eac5a0792ca (commit)
      from  90862ab4b2fb80ebbc89849bc28393da393022fb (commit)


- Log -----------------------------------------------------------------
commit 384cdd46a1184ae33c2fe76ad49f87b0c02d078a
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Aug 25 14:48:04 2017 +0200

    Fix guarding macro in include/internal/sockets.h
    
    The guard was checked but never defined.  Also, rename it to reflect
    that this is an internal header file, not a public one.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/4254)

commit 9a5d80cb5e44aa0908f4b10e5fca1eac5a0792ca
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Aug 25 14:36:01 2017 +0200

    Move more socket stuff
    
    The socket stuff for DJGPP and VMS was only partially moved to
    include/internal/sockets.h...
    
    Remains vxWorks.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/4254)

-----------------------------------------------------------------------

Summary of changes:
 e_os.h                     |   9 ----
 include/internal/sockets.h | 113 +++++++++++++++++++++++++--------------------
 2 files changed, 63 insertions(+), 59 deletions(-)

diff --git a/e_os.h b/e_os.h
index 0ec6da9..d7e7185 100644
--- a/e_os.h
+++ b/e_os.h
@@ -91,7 +91,6 @@ extern "C" {
 # endif
 
 # if defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_UEFI)
-#  define NO_SYS_PARAM_H
 #  define NO_CHMOD
 #  define NO_SYSLOG
 # endif
@@ -113,7 +112,6 @@ extern "C" {
 # endif
 
 # ifdef WIN32
-#  define NO_SYS_UN_H
 #  undef get_last_sys_error
 #  undef clear_sys_error
 #  define get_last_sys_error()    GetLastError()
@@ -129,10 +127,6 @@ extern "C" {
 #  ifdef __DJGPP__
 #   include <unistd.h>
 #   include <sys/stat.h>
-#   include <sys/socket.h>
-#   include <sys/un.h>
-#   include <tcp.h>
-#   include <netdb.h>
 #   define _setmode setmode
 #   define _O_TEXT O_TEXT
 #   define _O_BINARY O_BINARY
@@ -311,9 +305,6 @@ extern FILE *_imp___iob;
   */
 #   define EXIT(n)  exit((n) ? (((n) << 3) | 2 | 0x10000000 | 0x35a000) : 1)
 
-#   define NO_SYS_PARAM_H
-#   define NO_SYS_UN_H
-
 #   define DEFAULT_HOME "SYS$LOGIN:"
 
 #  else
diff --git a/include/internal/sockets.h b/include/internal/sockets.h
index c64e74c..fa958c4 100644
--- a/include/internal/sockets.h
+++ b/include/internal/sockets.h
@@ -8,26 +8,42 @@
  */
 
 
-#ifndef HEADER_OPENSSL_SOCKETS
+#ifndef HEADER_INTERNAL_SOCKETS
+# define HEADER_INTERNAL_SOCKETS
+
+# if defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_UEFI)
+#  define NO_SYS_PARAM_H
+# endif
+# ifdef WIN32
+#  define NO_SYS_UN_H
+# endif
+# ifdef OPENSSL_SYS_VMS
+#  define NO_SYS_PARAM_H
+#  define NO_SYS_UN_H
+# endif
 
 # ifdef OPENSSL_NO_SOCK
 
 # elif defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
-#  if !defined(__DJGPP__)
-#   if defined(_WIN32_WCE) && _WIN32_WCE<410
-#    define getservbyname _masked_declaration_getservbyname
-#   endif
-#   if !defined(IPPROTO_IP)
-     /* winsock[2].h was included already? */
-#    include <winsock.h>
-#   endif
-#   ifdef getservbyname
+#  if defined(__DJGPP__)
+#   include <sys/socket.h>
+#   include <sys/un.h>
+#   include <tcp.h>
+#   include <netdb.h>
+#  elif defined(_WIN32_WCE) && _WIN32_WCE<410
+#   define getservbyname _masked_declaration_getservbyname
+#  endif
+#  if !defined(IPPROTO_IP)
+    /* winsock[2].h was included already? */
+#   include <winsock.h>
+#  endif
+#  ifdef getservbyname
      /* this is used to be wcecompat/include/winsock_extras.h */
-#    undef getservbyname
+#   undef getservbyname
 struct servent *PASCAL getservbyname(const char *, const char *);
-#   endif
+#  endif
 
-#   ifdef _WIN64
+#  ifdef _WIN64
 /*
  * Even though sizeof(SOCKET) is 8, it's safe to cast it to int, because
  * the value constitutes an index in per-process table of limited size
@@ -35,10 +51,8 @@ struct servent *PASCAL getservbyname(const char *, const char *);
  * Windows run on happen to be two's-complement, which allows to
  * interchange INVALID_SOCKET and -1.
  */
-#    define socket(d,t,p)   ((int)socket(d,t,p))
-#    define accept(s,f,l)   ((int)accept(s,f,l))
-#   endif
-#  else
+#   define socket(d,t,p)   ((int)socket(d,t,p))
+#   define accept(s,f,l)   ((int)accept(s,f,l))
 #  endif
 
 # else
@@ -112,38 +126,37 @@ struct servent *PASCAL getservbyname(const char *, const char *);
 #  endif
 # endif
 
-#endif
+# define get_last_socket_error() errno
+# define clear_socket_error()    errno=0
+
+# if defined(OPENSSL_SYS_WINDOWS)
+#  undef get_last_socket_error
+#  undef clear_socket_error
+#  define get_last_socket_error() WSAGetLastError()
+#  define clear_socket_error()    WSASetLastError(0)
+#  define readsocket(s,b,n)       recv((s),(b),(n),0)
+#  define writesocket(s,b,n)      send((s),(b),(n),0)
+# elif defined(__DJGPP__)
+#  define WATT32
+#  define WATT32_NO_OLDIES
+#  define closesocket(s)          close_s(s)
+#  define readsocket(s,b,n)       read_s(s,b,n)
+#  define writesocket(s,b,n)      send(s,b,n,0)
+# elif defined(OPENSSL_SYS_VMS)
+#  define ioctlsocket(a,b,c)      ioctl(a,b,c)
+#  define closesocket(s)          close(s)
+#  define readsocket(s,b,n)       recv((s),(b),(n),0)
+#  define writesocket(s,b,n)      send((s),(b),(n),0)
+# elif defined(OPENSSL_SYS_VXWORKS)
+#  define ioctlsocket(a,b,c)          ioctl((a),(b),(int)(c))
+#  define closesocket(s)              close(s)
+#  define readsocket(s,b,n)           read((s),(b),(n))
+#  define writesocket(s,b,n)          write((s),(char *)(b),(n))
+# else
+#  define ioctlsocket(a,b,c)      ioctl(a,b,c)
+#  define closesocket(s)          close(s)
+#  define readsocket(s,b,n)       read((s),(b),(n))
+#  define writesocket(s,b,n)      write((s),(b),(n))
+# endif
 
-#define get_last_socket_error() errno
-#define clear_socket_error()    errno=0
-
-#if defined(OPENSSL_SYS_WINDOWS)
-# undef get_last_socket_error
-# undef clear_socket_error
-# define get_last_socket_error() WSAGetLastError()
-# define clear_socket_error()    WSASetLastError(0)
-# define readsocket(s,b,n)       recv((s),(b),(n),0)
-# define writesocket(s,b,n)      send((s),(b),(n),0)
-#elif defined(__DJGPP__)
-# define WATT32
-# define WATT32_NO_OLDIES
-# define closesocket(s)          close_s(s)
-# define readsocket(s,b,n)       read_s(s,b,n)
-# define writesocket(s,b,n)      send(s,b,n,0)
-#elif defined(OPENSSL_SYS_VMS)
-# define ioctlsocket(a,b,c)      ioctl(a,b,c)
-# define closesocket(s)          close(s)
-# define readsocket(s,b,n)       recv((s),(b),(n),0)
-# define writesocket(s,b,n)      send((s),(b),(n),0)
-#elif defined(OPENSSL_SYS_VXWORKS)
-# define ioctlsocket(a,b,c)          ioctl((a),(b),(int)(c))
-# define closesocket(s)              close(s)
-# define readsocket(s,b,n)           read((s),(b),(n))
-# define writesocket(s,b,n)          write((s),(char *)(b),(n))
-#else
-# define ioctlsocket(a,b,c)      ioctl(a,b,c)
-# define closesocket(s)          close(s)
-# define readsocket(s,b,n)       read((s),(b),(n))
-# define writesocket(s,b,n)      write((s),(b),(n))
 #endif
-


More information about the openssl-commits mailing list