minix/lib/utils/env_panic.c
Jorrit Herder 6d23f072f3 Cleaned up src/lib/utils library. Renamed server_ functions to more logical
names. All system processes can now either use panic() or report() from
libutils, or redefine their own function. Assertions are done via the standard
<assert.h> functionality.
2005-06-01 14:31:00 +00:00

20 lines
641 B
C

#include "utils.h"
#include <string.h>
/*=========================================================================*
* env_panic *
*=========================================================================*/
PUBLIC void env_panic(key)
char *key; /* environment variable whose value is bogus */
{
static char value[EP_BUF_SIZE] = "<unknown>";
int s;
if ((s=sys_getkenv(key, strlen(key), value, sizeof(value))) == 0) {
if (s != ESRCH) /* only error allowed */
printf("WARNING: sys_getkenv() failed in env_panic(): %d\n", s);
}
printf("Bad environment setting: '%s = %s'\n", key, value);
panic("","", NO_NUM);
}