File: die.c

package info (click to toggle)
zmailer 2.99.51.52pre3-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 16,596 kB
  • ctags: 7,422
  • sloc: ansic: 90,470; sh: 3,608; makefile: 2,784; perl: 1,585; python: 115; awk: 22
file content (39 lines) | stat: -rw-r--r-- 718 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 *	Copyright 1988 by Rayan S. Zachariassen, all rights reserved.
 *	This will be free software, but only when it is finished.
 */

#include <stdio.h>
#include "hostenv.h"
#include "mailer.h"
#include "libz.h"

/*
 * Abnormal death: blabber about why we are croaking, then die.
 */

extern char *progname;

void
die(status, message)
	int status;
	const char *message;
{
#ifdef	MALLOC_TRACE
	int i;

	for (i = 0; i < 10; ++i)
		memstats(i);
	mal_dumpleaktrace(stderr);
	/* mal_heapdump(stderr); */
	prsymtable();
#endif	/* MALLOC_TRACE */

	if (message != NULL) {
		fprintf(stderr, "%s: exit(%d): %s\n",
				progname, status, message);
	} else
		fprintf(stderr, "%s: exit(%d)\n", progname, status);
	exit(status);
}