* Copyright (c) 1986 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
static char sccsid
[] = "@(#)error.c 5.3 (Berkeley) 87/04/11";
static short err_redir
; /* stderr redirected */
* redirect stderr for error processing
if (!freopen(ERROR_FILE
, "a", stderr
))
error("can't open error file %s.\n", ERROR_FILE
);
* write errors to log file and die
static char logmsg
[MAXLINELEN
]; /* syslog message */
char *strcpy(), *strcat();
/* don't combine these, "fmt" may not require "arg" */
fprintf(stderr
, fmt
, arg
);
fprintf(stderr
, "\n\ttemporary file is %s.\n", tmpname
);
sprintf(logmsg
, "bugfiler: %s", fmt
);
syslog(LOG_ERR
, logmsg
, arg
);