Closed mchome closed 6 years ago
Use WSAGetLastError instead of using perror.
WSAGetLastError
perror
#include <stdio.h> #include <stdlib.h>
void DieWithError(char *errorMessage) { perror(errorMessage); exit(1); }
- Win32 build ```c #include <winsock.h> #include <stdlib.h> void DieWithError(char *errorMessage) { fprintf(stderr,"%s: %d\n", errorMessage, WSAGetLastError()); exit(1); }
Use
WSAGetLastError
instead of usingperror
.void DieWithError(char *errorMessage) { perror(errorMessage); exit(1); }