udb_misc.c
udb_misc.c · 1003 B
From the archive tinymush-p6.tar.gz
Download the archive « Back to the archive contents
/*
Misc support routines for unter style error management.
Stolen from mjr.
Modded to scribble on stderr, for now.
Andrew Molitor, amolitor@eagle.wesleyan.edu
*/
#include "udb_defs.h"
#include <stdio.h>
#include <errno.h>
#include <varargs.h>
#ifdef VMS
noshare extern char *sys_errlist[];
#endif
extern int errno;
extern char *sys_errlist[];
/*
print a series of warnings - do not exit
*/
/* VARARGS */
void
logf(va_alist)
va_dcl
{
char *p;
va_list ap;
va_start(ap);
while(1) {
p = va_arg(ap,char *);
if(p == (char *)0)
break;
if(p == (char *)-1)
p = sys_errlist[errno];
(void)fprintf(stderr,"%s",p);
}
va_end(ap);
(void)fflush(stderr);
}
/*
print a series of warnings - exit
*/
/* VARARGS */
void
fatal(va_alist)
va_dcl
{
char *p;
va_list ap;
va_start(ap);
while(1) {
p = va_arg(ap,char *);
if(p == (char *)0)
break;
if(p == (char *)-1)
p = sys_errlist[errno];
(void)fprintf(stderr,"%s",p);
}
va_end(ap);
(void)fflush(stderr);
exit(1);
}