From 237b00049a7a2a3b4cdecce7d50ad6c023d93cde Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 12 May 2000 23:53:14 +0000 Subject: [PATCH] Moved GetLastErrorString to ntservice.c. I missed it before, thought it was unused but it's needed in ntservice.c --- libraries/liblber/nt_err.c | 27 --------------------------- libraries/liblutil/ntservice.c | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 28 deletions(-) diff --git a/libraries/liblber/nt_err.c b/libraries/liblber/nt_err.c index 78f5aa0cfb..ebcb3bb5f8 100644 --- a/libraries/liblber/nt_err.c +++ b/libraries/liblber/nt_err.c @@ -83,30 +83,3 @@ char *ber_pvt_wsa_err2string( int err ) } #undef __RETSTR - -#if 0 /* No one seems to be using these */ -char *ber_pvt_wsa_last_errstring( void ) -{ - return ber_pvt_wsa_err2string( WSAGetLastError() ); -} - -#include - -char *GetErrorString( int err ) -{ - static char msgBuf[1024]; - - FormatMessage( - FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - msgBuf, 1024, NULL ); - - return msgBuf; -} - -char *GetLastErrorString( void ) -{ - return GetErrorString( GetLastError() ); -} -#endif diff --git a/libraries/liblutil/ntservice.c b/libraries/liblutil/ntservice.c index ce036b4944..73acdd3754 100644 --- a/libraries/liblutil/ntservice.c +++ b/libraries/liblutil/ntservice.c @@ -43,7 +43,6 @@ ldap_pvt_thread_t start_status_tid, stop_status_tid; void (*stopfunc)(int); -/* in nt_err.c */ char *GetLastErrorString( void ); int srv_install(LPCTSTR lpszServiceName, LPCTSTR lpszDisplayName, @@ -429,4 +428,21 @@ void ReportSlapdShutdownComplete( ) } } +char *GetErrorString( int err ) +{ + static char msgBuf[1024]; + + FormatMessage( + FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + msgBuf, 1024, NULL ); + + return msgBuf; +} + +char *GetLastErrorString( void ) +{ + return GetErrorString( GetLastError() ); +} #endif -- 2.39.5