From 9a8c9d84e0d3cd5bac1c86829f495998c4151f92 Mon Sep 17 00:00:00 2001 From: franklahm Date: Sun, 5 Apr 2009 07:22:06 +0000 Subject: [PATCH] Adjust gethostid check, from HAT. --- configure.in | 5 ++--- etc/afpd/status.c | 12 ++++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/configure.in b/configure.in index dde99636..ec37454c 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -dnl $Id: configure.in,v 1.213 2009-03-20 09:10:25 franklahm Exp $ +dnl $Id: configure.in,v 1.214 2009-04-05 07:22:06 franklahm Exp $ dnl configure.in for netatalk AC_INIT(etc/afpd/main.c) @@ -135,8 +135,7 @@ AC_CHECK_FUNCS(getcwd gethostname gettimeofday getusershell mkdir rmdir select s AC_CHECK_FUNCS(backtrace_symbols) AC_CHECK_FUNCS(setlocale nl_langinfo) AC_CHECK_FUNCS(waitpid getcwd strdup strndup strnlen strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64) -AC_CHECK_FUNCS(strlcpy strlcat) -AC_CHECK_FUNCS(setlinebuf) +AC_CHECK_FUNCS(strlcpy strlcat setlinebuf gethostid) AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include ]) AC_CACHE_SAVE diff --git a/etc/afpd/status.c b/etc/afpd/status.c index a95c7fe3..389fdba1 100644 --- a/etc/afpd/status.c +++ b/etc/afpd/status.c @@ -1,5 +1,5 @@ /* - * $Id: status.c,v 1.22 2009-02-16 14:03:30 franklahm Exp $ + * $Id: status.c,v 1.23 2009-04-05 07:22:06 franklahm Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -18,9 +18,9 @@ #ifdef BSD4_4 #include -#ifndef USE_GETHOSTID +#ifndef HAVE_GETHOSTID #include -#endif /* USE_GETHOSTID */ +#endif /* HAVE_GETHOSTID */ #endif /* BSD4_4 */ #include @@ -194,14 +194,14 @@ static u_int16_t status_signature(char *data, int *servoffset, DSI *dsi, /* If signature type is a standard hostid... */ server_signature_hostid: /* 16-byte signature consists of copies of the hostid */ -#if defined(BSD4_4) && defined(USE_GETHOSTID) +#if defined(BSD4_4) && !defined(HAVE_GETHOSTID) mib[0] = CTL_KERN; mib[1] = KERN_HOSTID; len = sizeof(hostid); sysctl(mib, 2, &hostid, &len, NULL, 0); -#else /* BSD4_4 && USE_GETHOSTID */ +#else /* BSD4_4 && !HAVE_GETHOSTID */ hostid = gethostid(); -#endif /* BSD4_4 && USE_GETHOSTID */ +#endif /* BSD4_4 && !HAVE_GETHOSTID */ if (!hostid) { if (dsi) hostid = dsi->server.sin_addr.s_addr; -- 2.39.2