minix/minix/lib/libsys/env_panic.c
David van Moolenbroek 685aa79304 libsys: resolve clang warnings
Change-Id: Ic954ba8667b4d039172b8e0d2ec57674a479b8aa
2014-09-30 20:08:54 +00:00

19 lines
571 B
C

#include "sysutil.h"
#include <string.h>
#include <env.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);
}