+2000-02-15 Tom Yu <tlyu@mit.edu>
+
+ * server.c: Add code to set a signal handler for SIGHUP and a few
+ others so that purify will actually generate memory leak reports.
+
+ * configure.in: Add CHECK_SIGNALS.
+
2000-02-07 Tom Yu <tlyu@mit.edu>
* config/unix.exp: Call send_error instead of fail to prevent
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <signal.h>
#include <gssrpc/rpc.h>
#include <arpa/inet.h> /* inet_ntoa */
#include <gssapi/gssapi.h>
exit(1);
}
+void handlesig(void)
+{
+ exit(0);
+}
+
main(int argc, char **argv)
{
int c, prot;
auth_gssapi_name names[2];
register SVCXPRT *transp;
extern int optind;
+#ifdef POSIX_SIGNALS
+ struct sigaction sa;
+#endif
names[0].name = SERVICE_NAME;
names[0].type = (gss_OID) gss_nt_service_name;
_svcauth_gssapi_set_log_badverf_func(rpc_test_badverf, NULL);
_svcauth_gssapi_set_log_miscerr_func(log_miscerr, NULL);
+#ifdef POSIX_SIGNALS
+ (void) sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+ sa.sa_handler = handlesig;
+ (void) sigaction(SIGHUP, &sa, NULL);
+ (void) sigaction(SIGINT, &sa, NULL);
+ (void) sigaction(SIGTERM, &sa, NULL);
+#else
+ signal(SIGHUP, handlesig);
+ signal(SIGINT, handlesig);
+ signal(SIGTERM, handlesig);
+#endif
printf("running\n");
svc_run();