krb5 commit: Correct comments in port-sockets.h

Greg Hudson ghudson at MIT.EDU
Thu Jul 12 00:19:33 EDT 2012


https://github.com/krb5/krb5/commit/666be8d6bd1063774c4260e2119ba4aed8fbfa9f
commit 666be8d6bd1063774c4260e2119ba4aed8fbfa9f
Author: Greg Hudson <ghudson at mit.edu>
Date:   Thu Jul 12 00:18:51 2012 -0400

    Correct comments in port-sockets.h

 src/include/port-sockets.h |   43 ++++++++++++++++++++-----------------------
 1 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/src/include/port-sockets.h b/src/include/port-sockets.h
index 0ccc670..d942908 100644
--- a/src/include/port-sockets.h
+++ b/src/include/port-sockets.h
@@ -7,8 +7,8 @@
 #include <ws2tcpip.h>
 #include <errno.h>
 
-/* Some of our own infrastructure where the WinSock stuff was too hairy
-   to dump into a clean Unix program...  */
+/* Some of our own infrastructure where the Winsock stuff was too hairy
+ * to dump into a clean Unix program */
 
 typedef WSABUF sg_buf;
 
@@ -33,9 +33,11 @@ typedef WSABUF sg_buf;
 #define SOCKET_CLOSE            close /* XXX */
 #define SOCKET_EINTR            WSAEINTR
 
-/* Return -1 for error or number of bytes written.
-   TMP is a temporary variable; must be declared by the caller, and
-   must be used by this macro (to avoid compiler warnings).  */
+/*
+ * Return -1 for error or number of bytes written.  TMP is a temporary
+ * variable; must be declared by the caller, and must be used by this macro (to
+ * avoid compiler warnings).
+ */
 /* WSASend returns 0 or SOCKET_ERROR.  */
 #define SOCKET_WRITEV_TEMP DWORD
 #define SOCKET_WRITEV(FD, SG, LEN, TMP)                         \
@@ -46,8 +48,8 @@ typedef WSABUF sg_buf;
 #define SHUTDOWN_BOTH   SD_BOTH
 
 /*
- * Define any missing Posix socket errors
- * This is for compatibiliy with older versions of msvc (pre-2010)
+ * Define any missing POSIX socket errors.  This is for compatibility with
+ * older versions of MSVC (pre-2010).
  */
 #ifndef EINPROGRESS
 #define EINPROGRESS WSAEINPROGRESS
@@ -72,9 +74,8 @@ typedef WSABUF sg_buf;
 #endif
 
 /*
- * Translate WinSock errors to their Posix counterparts.
- * This is necessary for msvc 2010+, where both WinSock and Posix errors
- * are defined.
+ * Translate Winsock errors to their POSIX counterparts.  This is necessary for
+ * MSVC 2010+, where both Winsock and POSIX errors are defined.
  */
 static __inline int TranslatedWSAGetLastError()
 {
@@ -102,8 +103,8 @@ static __inline int TranslatedWSAGetLastError()
 
 #elif defined(__palmos__)
 
-/* If this source file requires it, define struct sockaddr_in
-   (and possibly other things related to network I/O).  */
+/* If this source file requires it, define struct sockaddr_in (and possibly
+ * other things related to network I/O). */
 
 #include "autoconf.h"
 #include <netdb.h>
@@ -133,14 +134,15 @@ extern int h_errno;             /* In case it's missing, e.g., HP-UX 10.20. */
 #include <sys/filio.h>          /* For FIONBIO on Solaris.  */
 #endif
 
-/* Either size_t or int or unsigned int is probably right.  Under
-   SunOS 4, it looks like int is desired, according to the accept man
-   page.  */
+/*
+ * Either size_t or int or unsigned int is probably right.  Under
+ * SunOS 4, it looks like int is desired, according to the accept man
+ * page.
+ */
 #ifndef HAVE_SOCKLEN_T
 typedef int socklen_t;
 #endif
 
-/* XXX should only be done if sockaddr_storage not found */
 #ifndef HAVE_STRUCT_SOCKADDR_STORAGE
 struct krb5int_sockaddr_storage {
     struct sockaddr_in s;
@@ -150,9 +152,7 @@ struct krb5int_sockaddr_storage {
 #define sockaddr_storage krb5int_sockaddr_storage
 #endif
 
-/*
- * Compatability with WinSock calls on MS-Windows...
- */
+/* Unix equivalents of Winsock calls */
 #define SOCKET          int
 #define INVALID_SOCKET  ((SOCKET)~0)
 #define closesocket     close
@@ -171,9 +171,6 @@ typedef struct iovec sg_buf;
 #define SG_BUF(SG)              ((char*)(SG)->iov_base + 0)
 #define SG_SET(SG, B, L)        ((SG)->iov_base = (char*)(B), (SG)->iov_len = (L))
 
-/* Some of our own infrastructure where the WinSock stuff was too hairy
-   to dump into a clean Unix program...  */
-
 #define SOCKET_INITIALIZE()     (0)     /* No error (or anything else) */
 #define SOCKET_CLEANUP()        /* nothing */
 #define SOCKET_ERRNO            errno
@@ -187,7 +184,7 @@ typedef struct iovec sg_buf;
 #define SOCKET_EINTR            EINTR
 #define SOCKET_WRITEV_TEMP int
 /* Use TMP to avoid compiler warnings and keep things consistent with
-   Windoze version.  */
+ * Windows version. */
 #define SOCKET_WRITEV(FD, SG, LEN, TMP)         \
     ((TMP) = writev((FD), (SG), (LEN)), (TMP))
 


More information about the cvs-krb5 mailing list