From abb73bdcd085a93a9cbf447d16d832bad8827925 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sun, 2 Dec 2001 03:11:23 +0000 Subject: Fix 2 more signal handlers --- kerberosIV/src/kadmin/admin_server.c | 3 ++- kerberosIV/src/kadmin/kadmin.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'kerberosIV') diff --git a/kerberosIV/src/kadmin/admin_server.c b/kerberosIV/src/kadmin/admin_server.c index 7e368ce9d8e..5a9fcd8b69c 100644 --- a/kerberosIV/src/kadmin/admin_server.c +++ b/kerberosIV/src/kadmin/admin_server.c @@ -116,7 +116,8 @@ cleanexit(int val) static RETSIGTYPE sigalrm(int sig) { - cleanexit(1); + kerb_fini(); /* not a signal race -- kerb_fini() does NOTHING */ + _exit(val); } /* diff --git a/kerberosIV/src/kadmin/kadmin.c b/kerberosIV/src/kadmin/kadmin.c index 30c7d63306b..6fe636da434 100644 --- a/kerberosIV/src/kadmin/kadmin.c +++ b/kerberosIV/src/kadmin/kadmin.c @@ -351,7 +351,7 @@ clean_up() static int clean_up_cmd (int argc, char **argv) { - clean_up(); + clean_up(); /* roughly said, signal safe */ return 0; } @@ -435,8 +435,13 @@ do_init(int argc, char **argv) static void sigalrm(int sig) { - if(clean_up()) - printf("\nTickets destroyed.\n"); + int save_errno = errno; + + if(clean_up()) { /* roughly said, signal safe */ + write(STDOUT_FILENO, "\nTickets destroyed.\n", + strlen("\nTickets destroyed.\n")); + } + errno = save_errno; } int -- cgit v1.2.3