commit 904c8907275f13139e91bf1c3179f745d69f7fac
parent fd891de55bff0439c95c8eb1008f7055785a3886
Author: Christoph Lohmann <20h@r-36.net>
Date: Mon, 12 Nov 2018 22:34:30 +0100
Do not use HOST_NAME_MAX, NetBSD does not have it.
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/main.c b/main.c
@@ -23,7 +23,6 @@
#include <grp.h>
#include <errno.h>
#include <arpa/inet.h>
-#include <limits.h>
#include <sys/select.h>
#include <sys/time.h>
@@ -481,8 +480,9 @@ main(int argc, char *argv[])
usage();
if (ohost == NULL) {
- ohost = xcalloc(1, HOST_NAME_MAX+1);
- if (gethostname(ohost, HOST_NAME_MAX) < 0) {
+ /* Do not use MAX_NAME_HOST, it is not defined on NetBSD. */
+ ohost = xcalloc(1, 256+1);
+ if (gethostname(ohost, 256) < 0) {
perror("gethostname");
free(ohost);
return 1;