summaryrefslogtreecommitdiff
path: root/usr.bin/bgplg/bgplg.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/bgplg/bgplg.c')
-rw-r--r--usr.bin/bgplg/bgplg.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/bgplg/bgplg.c b/usr.bin/bgplg/bgplg.c
index 9d1019a17c6..fa1fb361168 100644
--- a/usr.bin/bgplg/bgplg.c
+++ b/usr.bin/bgplg/bgplg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgplg.c,v 1.15 2015/12/09 17:52:24 mmcc Exp $ */
+/* $OpenBSD: bgplg.c,v 1.16 2016/04/05 21:57:58 sthen Exp $ */
/*
* Copyright (c) 2005, 2006 Reyk Floeter <reyk@openbsd.org>
@@ -245,9 +245,8 @@ lg_incl(const char *file)
int
main(void)
{
- char *query, *self, *cmd = NULL, *req;
+ char *query, *myname, *self, *cmd = NULL, *req;
char **argv = NULL;
- char myname[HOST_NAME_MAX+1];
int ret = 1, argc = 0, query_length = 0;
struct stat st;
u_int i;
@@ -256,7 +255,7 @@ main(void)
if (pledge("stdio rpath proc exec", NULL) == -1)
err(1, "pledge");
- if (gethostname(myname, sizeof(myname)) != 0)
+ if ((myname = lg_getenv("SERVER_NAME", NULL)) == NULL)
return (1);
printf("Content-Type: %s\n"