X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=libraries%2Fliblber%2Fnt_err.c;h=973afc4bfb0f1675900ae32f4e6f72fed487d6c7;hb=467a5bd9cd94abb7476d5ce9487fa1367668d056;hp=ebcb3bb5f8425df7c683c35d2c8cfb0e3c06cb0f;hpb=237b00049a7a2a3b4cdecce7d50ad6c023d93cde;p=openldap
diff --git a/libraries/liblber/nt_err.c b/libraries/liblber/nt_err.c
index ebcb3bb5f8..973afc4bfb 100644
--- a/libraries/liblber/nt_err.c
+++ b/libraries/liblber/nt_err.c
@@ -1,4 +1,18 @@
/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software .
+ *
+ * Copyright 1998-2009 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * .
+ */
+
#include "portable.h"
#ifdef HAVE_WINSOCK2
@@ -7,79 +21,76 @@
#include
#endif /* HAVE_WINSOCK(2) */
-#define __RETSTR( x ) case x: return #x;
+#define LBER_RETSTR( x ) case x: return #x;
char *ber_pvt_wsa_err2string( int err )
{
- switch( err )
- {
- __RETSTR( WSAEINTR )
- __RETSTR( WSAEBADF )
- __RETSTR( WSAEACCES )
- __RETSTR( WSAEFAULT )
- __RETSTR( WSAEINVAL )
- __RETSTR( WSAEMFILE )
- __RETSTR( WSAEWOULDBLOCK )
- __RETSTR( WSAEINPROGRESS )
- __RETSTR( WSAEALREADY )
- __RETSTR( WSAENOTSOCK )
- __RETSTR( WSAEDESTADDRREQ )
- __RETSTR( WSAEMSGSIZE )
- __RETSTR( WSAEPROTOTYPE )
- __RETSTR( WSAENOPROTOOPT )
- __RETSTR( WSAEPROTONOSUPPORT )
- __RETSTR( WSAESOCKTNOSUPPORT )
- __RETSTR( WSAEOPNOTSUPP )
- __RETSTR( WSAEPFNOSUPPORT )
- __RETSTR( WSAEAFNOSUPPORT )
- __RETSTR( WSAEADDRINUSE )
- __RETSTR( WSAEADDRNOTAVAIL )
- __RETSTR( WSAENETDOWN )
- __RETSTR( WSAENETUNREACH )
- __RETSTR( WSAENETRESET )
- __RETSTR( WSAECONNABORTED )
- __RETSTR( WSAECONNRESET )
- __RETSTR( WSAENOBUFS )
- __RETSTR( WSAEISCONN )
- __RETSTR( WSAENOTCONN )
- __RETSTR( WSAESHUTDOWN )
- __RETSTR( WSAETOOMANYREFS )
- __RETSTR( WSAETIMEDOUT )
- __RETSTR( WSAECONNREFUSED )
- __RETSTR( WSAELOOP )
- __RETSTR( WSAENAMETOOLONG )
- __RETSTR( WSAEHOSTDOWN )
- __RETSTR( WSAEHOSTUNREACH )
- __RETSTR( WSAENOTEMPTY )
- __RETSTR( WSAEPROCLIM )
- __RETSTR( WSAEUSERS )
- __RETSTR( WSAEDQUOT )
- __RETSTR( WSAESTALE )
- __RETSTR( WSAEREMOTE )
- __RETSTR( WSASYSNOTREADY )
- __RETSTR( WSAVERNOTSUPPORTED )
- __RETSTR( WSANOTINITIALISED )
- __RETSTR( WSAEDISCON )
+ switch( err ) {
+ LBER_RETSTR( WSAEINTR )
+ LBER_RETSTR( WSAEBADF )
+ LBER_RETSTR( WSAEACCES )
+ LBER_RETSTR( WSAEFAULT )
+ LBER_RETSTR( WSAEINVAL )
+ LBER_RETSTR( WSAEMFILE )
+ LBER_RETSTR( WSAEWOULDBLOCK )
+ LBER_RETSTR( WSAEINPROGRESS )
+ LBER_RETSTR( WSAEALREADY )
+ LBER_RETSTR( WSAENOTSOCK )
+ LBER_RETSTR( WSAEDESTADDRREQ )
+ LBER_RETSTR( WSAEMSGSIZE )
+ LBER_RETSTR( WSAEPROTOTYPE )
+ LBER_RETSTR( WSAENOPROTOOPT )
+ LBER_RETSTR( WSAEPROTONOSUPPORT )
+ LBER_RETSTR( WSAESOCKTNOSUPPORT )
+ LBER_RETSTR( WSAEOPNOTSUPP )
+ LBER_RETSTR( WSAEPFNOSUPPORT )
+ LBER_RETSTR( WSAEAFNOSUPPORT )
+ LBER_RETSTR( WSAEADDRINUSE )
+ LBER_RETSTR( WSAEADDRNOTAVAIL )
+ LBER_RETSTR( WSAENETDOWN )
+ LBER_RETSTR( WSAENETUNREACH )
+ LBER_RETSTR( WSAENETRESET )
+ LBER_RETSTR( WSAECONNABORTED )
+ LBER_RETSTR( WSAECONNRESET )
+ LBER_RETSTR( WSAENOBUFS )
+ LBER_RETSTR( WSAEISCONN )
+ LBER_RETSTR( WSAENOTCONN )
+ LBER_RETSTR( WSAESHUTDOWN )
+ LBER_RETSTR( WSAETOOMANYREFS )
+ LBER_RETSTR( WSAETIMEDOUT )
+ LBER_RETSTR( WSAECONNREFUSED )
+ LBER_RETSTR( WSAELOOP )
+ LBER_RETSTR( WSAENAMETOOLONG )
+ LBER_RETSTR( WSAEHOSTDOWN )
+ LBER_RETSTR( WSAEHOSTUNREACH )
+ LBER_RETSTR( WSAENOTEMPTY )
+ LBER_RETSTR( WSAEPROCLIM )
+ LBER_RETSTR( WSAEUSERS )
+ LBER_RETSTR( WSAEDQUOT )
+ LBER_RETSTR( WSAESTALE )
+ LBER_RETSTR( WSAEREMOTE )
+ LBER_RETSTR( WSASYSNOTREADY )
+ LBER_RETSTR( WSAVERNOTSUPPORTED )
+ LBER_RETSTR( WSANOTINITIALISED )
+ LBER_RETSTR( WSAEDISCON )
#ifdef HAVE_WINSOCK2
- __RETSTR( WSAENOMORE )
- __RETSTR( WSAECANCELLED )
- __RETSTR( WSAEINVALIDPROCTABLE )
- __RETSTR( WSAEINVALIDPROVIDER )
- __RETSTR( WSASYSCALLFAILURE )
- __RETSTR( WSASERVICE_NOT_FOUND )
- __RETSTR( WSATYPE_NOT_FOUND )
- __RETSTR( WSA_E_NO_MORE )
- __RETSTR( WSA_E_CANCELLED )
- __RETSTR( WSAEREFUSED )
-#endif // HAVE_WINSOCK2
+ LBER_RETSTR( WSAENOMORE )
+ LBER_RETSTR( WSAECANCELLED )
+ LBER_RETSTR( WSAEINVALIDPROCTABLE )
+ LBER_RETSTR( WSAEINVALIDPROVIDER )
+ LBER_RETSTR( WSASYSCALLFAILURE )
+ LBER_RETSTR( WSASERVICE_NOT_FOUND )
+ LBER_RETSTR( WSATYPE_NOT_FOUND )
+ LBER_RETSTR( WSA_E_NO_MORE )
+ LBER_RETSTR( WSA_E_CANCELLED )
+ LBER_RETSTR( WSAEREFUSED )
+#endif /* HAVE_WINSOCK2 */
- __RETSTR( WSAHOST_NOT_FOUND )
- __RETSTR( WSATRY_AGAIN )
- __RETSTR( WSANO_RECOVERY )
- __RETSTR( WSANO_DATA )
+ LBER_RETSTR( WSAHOST_NOT_FOUND )
+ LBER_RETSTR( WSATRY_AGAIN )
+ LBER_RETSTR( WSANO_RECOVERY )
+ LBER_RETSTR( WSANO_DATA )
}
- return "unknown";
+ return "unknown WSA error";
}
-
-#undef __RETSTR