* 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.1 (Berkeley) 86/11/25";
extern char *distf
, /* redist temp file */
tmpname
[]; /* temporary file used */
short made_dist
; /* if dist file made */
static short err_redir
; /* stderr redirected */
* redirect stderr for error processing
if (!freopen(ERROR_FILE
,"a",stderr
))
error("unable to 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
,"\n\ttemporary file is %s.\n",tmpname
);
strcat(strcpy(logmsg
,"bugfiler: "),fmt
);
syslog(LOG_ERR
,logmsg
,arg
);
if (made_dist
) /* unlink redist file if necessary */