minix/lib/libsys/env_panic.c
Ben Gras b538531449 vm: make WARNS=5 proof
Change-Id: I737ded223daf04f1c0c85a2e8e6b36c8fdcd07db
2013-09-06 11:51:20 +02:00

17 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);
}