ReactOS  0.4.14-dev-57-g333b8f1
SError.c File Reference
#include "syshdrs.h"
Include dependency graph for SError.c:

Go to the source code of this file.

Functions

const charSError (int e)
 

Function Documentation

◆ SError()

const char* SError ( int  e)

Definition at line 141 of file SError.c.

142 {
143 #if defined(WIN32) || defined(_WINDOWS)
144  const char *cp;
145  static char estr[32];
146 
147  if (e == 0)
148  e = WSAGetLastError();
149 
150  if ((e >= WSABASEERR) && (e < (WSABASEERR + (sizeof(wsaerrlist) / sizeof(const char *))))) {
151  return wsaerrlist[e - WSABASEERR];
152  }
153 
154  cp = strerror(e);
155  if ((cp == NULL) || (cp[0] == '\0') || (strcmp(cp, "Unknown error") == 0)) {
156  wsprintf(estr, "Error #%d", e);
157  cp = estr;
158  }
159  return cp;
160 #elif defined(HAVE_STRERROR)
161  if (e == 0)
162  e = errno;
163  return strerror(e);
164 #else
165  static char estr[32];
166  if (e == 0)
167  e = errno;
168  sprintf(estr, "Error #%d", e);
169  return (estr);
170 #endif
171 } /* SError */
int errno
const char * strerror(int err)
Definition: compat_str.c:23
#define sprintf(buf, format,...)
Definition: sprintf.c:55
#define e
Definition: ke_i.h:82
smooth NULL
Definition: ftsmooth.c:416
INT WSAAPI WSAGetLastError(VOID)
Definition: dllmain.c:112
#define WSABASEERR
Definition: winerror.h:1941
POINT cp
Definition: magnifier.c:59
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define wsprintf
Definition: winuser.h:5766

Referenced by UniataAhciStart(), UniataAhciStatus(), UniataAhciWaitCommandReady(), and UniataSataClearErr().