SCCS-vsn: usr.sbin/sendmail/src/main.c 8.40
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)main.c 8.39 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c 8.40 (Berkeley) %G%";
#endif /* not lint */
#define _DEFINE
#endif /* not lint */
#define _DEFINE
extern char *getcfname();
extern char *optarg;
extern char **environ;
extern char *getcfname();
extern char *optarg;
extern char **environ;
+ extern void dumpstate();
/*
** Check to see if we reentered.
/*
** Check to see if we reentered.
/* do machine-dependent initializations */
init_md(argc, argv);
/* do machine-dependent initializations */
init_md(argc, argv);
+ /* arrange to dump state on signal */
+#ifdef SIGUSR1
+ setsignal(SIGUSR1, dumpstate);
+#endif
+
/* in 4.4BSD, the table can be huge; impose a reasonable limit */
DtableSize = getdtsize();
if (DtableSize > 256)
/* in 4.4BSD, the table can be huge; impose a reasonable limit */
DtableSize = getdtsize();
if (DtableSize > 256)
addheader("X-Authentication-Warning", buf, e);
}
}
addheader("X-Authentication-Warning", buf, e);
}
}
+\f/*
+** DUMPSTATE -- dump state on user signal
+**
+** For debugging.
+*/
+
+void
+dumpstate()
+{
+#ifdef LOG
+ syslog(LOG_DEBUG, "--- dumping state on user signal: open file descriptors: ---");
+ printopenfds(TRUE);
+ syslog(LOG_DEBUG, "--- connection cache: ---");
+ mci_dump_all(TRUE);
+ syslog(LOG_DEBUG, "--- end of state dump ---");
+#endif
+}