summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2012-07-12 00:18:51 -0400
committerGreg Hudson <ghudson@mit.edu>2012-07-12 00:18:51 -0400
commit666be8d6bd1063774c4260e2119ba4aed8fbfa9f (patch)
tree430b8c156f915e422f1c5b96dc904650c0f6dd39
parent244bb3fde58dd6bab0969e0501b537c5871088f0 (diff)
downloadkrb5-666be8d6bd1063774c4260e2119ba4aed8fbfa9f.tar.gz
krb5-666be8d6bd1063774c4260e2119ba4aed8fbfa9f.tar.xz
krb5-666be8d6bd1063774c4260e2119ba4aed8fbfa9f.zip
Correct comments in port-sockets.h
-rw-r--r--src/include/port-sockets.h43
1 files changed, 20 insertions, 23 deletions
diff --git a/src/include/port-sockets.h b/src/include/port-sockets.h
index 0ccc670e71..d9429088f1 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))