00001 /* errexit.cpp - errexit */ 00002 00003 #include <windows.h> 00004 #include <stdarg.h> 00005 #include <stdio.h> 00006 #include <stdlib.h> 00007 #include <winsock.h> 00008 00009 /*------------------------------------------------------------------------ 00010 * errexit - print an error message and exit 00011 *------------------------------------------------------------------------ 00012 */ 00013 /*VARARGS1*/ 00014 void 00015 errexit(const char *format, ...) 00016 { 00017 va_list args; 00018 00019 va_start(args, format); 00020 vfprintf(stderr, format, args); 00021 va_end(args); 00022 WSACleanup(); 00023 exit(1); 00024 }