version 1.3, 1997/01/12 23:43:05 |
version 1.4, 1999/02/03 02:09:30 |
|
|
#ifndef lint |
#ifndef lint |
#if 0 |
#if 0 |
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/6/93"; |
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/6/93"; |
#endif |
#else |
static char rcsid[] = "$OpenBSD$"; |
static char rcsid[] = "$OpenBSD$"; |
|
#endif |
#endif /* not lint */ |
#endif /* not lint */ |
|
|
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/stat.h> |
#include <sys/stat.h> |
|
#include <err.h> |
#include <errno.h> |
#include <errno.h> |
#include <unistd.h> |
#include <unistd.h> |
#include <stdio.h> |
#include <stdio.h> |
|
|
void |
void |
ierr() |
ierr() |
{ |
{ |
err(0, "%s: %s", fname, strerror(errno)); |
|
|
warn("%s", fname); |
|
rval = 1; |
} |
} |
|
|
void |
void |
oerr() |
oerr() |
{ |
{ |
err(1, "stdout: %s", strerror(errno)); |
|
} |
|
|
|
#if __STDC__ |
err(1, "stdout"); |
#include <stdarg.h> |
|
#else |
|
#include <varargs.h> |
|
#endif |
|
|
|
void |
|
#if __STDC__ |
|
err(int fatal, const char *fmt, ...) |
|
#else |
|
err(fatal, fmt, va_alist) |
|
int fatal; |
|
char *fmt; |
|
va_dcl |
|
#endif |
|
{ |
|
va_list ap; |
|
#if __STDC__ |
|
va_start(ap, fmt); |
|
#else |
|
va_start(ap); |
|
#endif |
|
(void)fprintf(stderr, "tail: "); |
|
(void)vfprintf(stderr, fmt, ap); |
|
va_end(ap); |
|
(void)fprintf(stderr, "\n"); |
|
if (fatal) |
|
exit(1); |
|
rval = 1; |
|
} |
} |