phunix/minix/lib/libsys/env_panic.c
David van Moolenbroek 5f6c420586 Retire env.h
This was a MINIX3-specific header file placed outside of the minix/
header subdirectory, with its definitions duplicated in the more
standard minix/sysutil.h header.

Also make env_prefix(3) take constant pointers.

Change-Id: I243c38eb38e24eb98f0c0dddf7f340e7fec255f4
2017-02-16 10:22:27 +00:00

18 lines
554 B
C

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