#include <signal.h>
#include <com_err.h>
-#ifdef USE_SIGPROCMASK
-/* fake sigmask, sigblock, sigsetmask */
-#include <signal.h>
-#define sigmask(x) (1L<<(x)-1)
-#define sigsetmask(x) sigprocmask(SIG_SETMASK,&x,NULL)
-static int _fake_sigstore;
-#define sigblock(x) (_fake_sigstore=x,sigprocmask(SIG_BLOCK,&_fake_sigstore,0))
-#endif
-
#ifndef sigmask
#define sigmask(m) (1 <<((m)-1))
#endif
int adm_debug_flag = 0;
+#ifdef USE_SIGPROCMASK
+/* just do it right */
+void
+kill_children()
+{
+ int i;
+ sigset_t old, new;
+
+ sigemptyset(&old);
+ sigemptyset(&new);
+ sigaddset(&new,SIGCHLD);
+ sigprocmask(SIG_BLOCK, &new, &old);
+
+ for (i = 0; i < pidarraysize; i++) {
+ kill(pidarray[i], SIGINT);
+ krb_log("killing child %d", pidarray[i]);
+ }
+
+ sigprocmask(SIG_SETMASK, &old, NULL);
+}
+
+#else
+
+#ifdef USE_SIGPROCMASK
+/* fake sigmask, sigblock, sigsetmask */
+#include <signal.h>
+#define sigmask(x) (1L<<(x)-1)
+#define sigsetmask(x) sigprocmask(SIG_SETMASK,&x,NULL)
+static int _fake_sigstore;
+#define sigblock(x) (_fake_sigstore=x,sigprocmask(SIG_BLOCK,&_fake_sigstore,0))
+#endif
+
void
kill_children()
{
sigsetmask(osigmask);
return;
}
+#endif /* HAVE_SIGSET */
/*
adm5_listen_and_process - listen on the admin servers port for a request