Mercurial > blahgd > experimental
changeset 1017:173eaab07272
req: use libjeffpc's xgethostname to get the current hostname
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Fri, 15 Mar 2019 11:51:11 -0400 |
parents | 3b583965087a |
children | 8117b33fb54b |
files | req.c |
diffstat | 1 files changed, 2 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/req.c Fri Mar 15 12:02:15 2019 -0400 +++ b/req.c Fri Mar 15 11:51:11 2019 -0400 @@ -20,13 +20,11 @@ * SOFTWARE. */ -#include <unistd.h> -#include <sys/systeminfo.h> - #include <jeffpc/atomic.h> #include <jeffpc/int.h> #include <jeffpc/mem.h> #include <jeffpc/thread.h> +#include <jeffpc/sock.h> #include <jeffpc/version.h> #include "req.h" @@ -118,7 +116,6 @@ { struct scgi *scgi = req->scgi; char fname[FILENAME_MAX]; - char hostname[128]; struct nvlist *logentry; struct nvlist *tmp; struct buffer *buf; @@ -127,8 +124,6 @@ now = gettime(); - sysinfo(SI_HOSTNAME, hostname, sizeof(hostname)); - snprintf(fname, sizeof(fname), "%s/requests/%"PRIu64".%09"PRIu64"-%011u", str_cstr(config.data_dir), now / 1000000000llu, now % 1000000000llu, scgi->id); @@ -141,7 +136,7 @@ goto err; nvl_set_int(logentry, "time-stamp", now); nvl_set_int(logentry, "pid", getpid()); - nvl_set_str(logentry, "hostname", STR_DUP(hostname)); + nvl_set_str(logentry, "hostname", STR_DUP(xgethostname())); /* * store the version info