From 88ef8898b88735da641774796b0eef0ba2fb904c Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Sun, 21 Jul 1991 21:50:09 -0800 Subject: [PATCH] date and time created 91/07/21 14:50:09 by bostic SCCS-vsn: usr.bin/tail/misc.c 5.1 --- usr/src/usr.bin/tail/misc.c | 63 +++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 usr/src/usr.bin/tail/misc.c diff --git a/usr/src/usr.bin/tail/misc.c b/usr/src/usr.bin/tail/misc.c new file mode 100644 index 0000000000..270427864d --- /dev/null +++ b/usr/src/usr.bin/tail/misc.c @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 1991 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Edward Sze-Tyan Wang. + * + * %sccs.include.redist.c% + */ + +#ifndef lint +static char sccsid[] = "@(#)misc.c 5.1 (Berkeley) %G%"; +#endif /* not lint */ + +#include +#include +#include +#include +#include +#include +#include +#include "extern.h" + +void +ierr() +{ + err("%s: %s", fname, strerror(errno)); +} + +void +oerr() +{ + err("stdout: %s", strerror(errno)); +} + +#if __STDC__ +#include +#else +#include +#endif + +void +#if __STDC__ +err(const char *fmt, ...) +#else +err(fmt, va_alist) + 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"); + exit(1); + /* NOTREACHED */ +} -- 2.20.1