The header and the man page say that sethostid() returns void, so make the

definition match.  Include <unistd.h>.
This commit is contained in:
Stefan Farfeleder 2005-09-10 13:54:42 +00:00
parent 16ca32b39f
commit 442a7dde61

View File

@ -40,14 +40,14 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h> #include <sys/param.h>
#include <sys/sysctl.h> #include <sys/sysctl.h>
long #include <unistd.h>
void
sethostid(long hostid) sethostid(long hostid)
{ {
int mib[2]; int mib[2];
mib[0] = CTL_KERN; mib[0] = CTL_KERN;
mib[1] = KERN_HOSTID; mib[1] = KERN_HOSTID;
if (sysctl(mib, 2, NULL, NULL, &hostid, sizeof hostid) == -1) sysctl(mib, 2, NULL, NULL, &hostid, sizeof hostid);
return (-1);
return (0);
} }