If sysctl() fails, return "/kernel" so as not to screw people who haven't

updated their kernels yet.
This commit is contained in:
Garrett Wollman 1994-09-24 00:10:13 +00:00
parent 4be4929c2b
commit a2647fcdec
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=3042

View File

@ -34,7 +34,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char sccsid[] = "From: @(#)gethostname.c 8.1 (Berkeley) 6/4/93";*/
static const char rcsid[] =
"$Id$";
"$Id: getbootfile.c,v 1.1 1994/09/23 20:22:01 wollman Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@ -50,6 +50,6 @@ getbootfile(void)
mib[0] = CTL_KERN;
mib[1] = KERN_BOOTFILE;
if (sysctl(mib, 2, name, &size, NULL, 0) == -1)
return (0);
return ("/kernel");
return (name);
}