|
|
@ -1,4 +1,4 @@ |
|
|
|
/* $OpenBSD: log.c,v 1.11 2015/01/08 05:34:21 bcook Exp $ */ |
|
|
|
/* $OpenBSD: log.c,v 1.12 2015/12/19 13:58:08 reyk Exp $ */ |
|
|
|
|
|
|
|
/* |
|
|
|
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> |
|
|
@ -16,10 +16,12 @@ |
|
|
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
|
|
|
*/ |
|
|
|
|
|
|
|
#include <sys/types.h> |
|
|
|
#include <sys/queue.h> |
|
|
|
#include <sys/tree.h> |
|
|
|
#include <sys/socket.h> |
|
|
|
|
|
|
|
#include <errno.h> |
|
|
|
#include <netdb.h> |
|
|
|
#include <pwd.h> |
|
|
|
#include <stdarg.h> |
|
|
|
#include <stdio.h> |
|
|
@ -198,15 +200,3 @@ fatalx(const char *emsg, ...) |
|
|
|
va_end(ap); |
|
|
|
exit(1); |
|
|
|
} |
|
|
|
|
|
|
|
const char * |
|
|
|
log_sockaddr(struct sockaddr *sa) |
|
|
|
{ |
|
|
|
static char buf[NI_MAXHOST]; |
|
|
|
|
|
|
|
if (getnameinfo(sa, SA_LEN(sa), buf, sizeof(buf), NULL, 0, |
|
|
|
NI_NUMERICHOST)) |
|
|
|
return ("(unknown)"); |
|
|
|
else |
|
|
|
return (buf); |
|
|
|
} |