mirror of
https://github.com/nmap/nmap.git
synced 2025-12-18 05:29:02 +00:00
Merged nsock-engines from nmap-exp. This rewrite of the nsock library adds
support for system-specific scalable IO notification facilities without breaking portability. This initial version comes with an epoll(7)-based engine for Linux and a select(2)-based fallback engine for all other operating systems. This required an important refactoring of the library but the external API was preserved. The rewrite also tries to bring the coding standards of nmap to nsock. See http://labs.unix-junkies.org/nsock_engines.html for the details.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
/***************************************************************************
|
||||
* error.c -- a few simple routines for dealing with errors (quitting, *
|
||||
* printing error messages, etc. *
|
||||
@@ -59,28 +58,40 @@
|
||||
#include "error.h"
|
||||
|
||||
void fatal(char *fmt, ...) {
|
||||
va_list ap;va_start(ap, fmt);
|
||||
fflush(stdout);vfprintf(stderr, fmt, ap);
|
||||
fprintf(stderr, "\n");va_end(ap);
|
||||
exit(1);}
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
fflush(stdout);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
fprintf(stderr, "\n");
|
||||
va_end(ap);
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void pfatal(char *fmt, ...) {
|
||||
va_list ap;va_start(ap, fmt);
|
||||
fflush(stdout);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
fprintf(stderr, ": ");
|
||||
perror("");
|
||||
fprintf(stderr, "\n");
|
||||
va_end(ap);
|
||||
exit(1);
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
fflush(stdout);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
fprintf(stderr, ": ");
|
||||
perror("");
|
||||
fprintf(stderr, "\n");
|
||||
va_end(ap);
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void gh_perror(char *err, ...) {
|
||||
va_list ap;va_start(ap, err);
|
||||
fflush(stdout);
|
||||
vfprintf(stderr, err, ap);
|
||||
va_end(ap);
|
||||
perror(" ");
|
||||
fflush(stderr);
|
||||
return;
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, err);
|
||||
fflush(stdout);
|
||||
vfprintf(stderr, err, ap);
|
||||
va_end(ap);
|
||||
|
||||
perror(" ");
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user