diff options
| author | Stephen Hanson <Stephen.Hanson@Sun.COM> | 2009-08-24 13:00:47 -0700 |
|---|---|---|
| committer | Stephen Hanson <Stephen.Hanson@Sun.COM> | 2009-08-24 13:00:47 -0700 |
| commit | 5ad1f010a7b934be6e0dd6c13198af62791824be (patch) | |
| tree | 42e3cf36d3c12ea2791cf9d6a5ffed9dfaac727c | |
| parent | 2f349fb3f7f2c951525d92f15ef050d897ec3244 (diff) | |
| download | illumos-joyent-5ad1f010a7b934be6e0dd6c13198af62791824be.tar.gz | |
6853894 syseventd is core dumping on snv_117
6860272 syseventd: [daemon.error] Fatal:attempting to dump core
4902139 syseventd lies about dumping core
6522182 syseventd doesn't work with both the options -r and -d
| -rw-r--r-- | usr/src/cmd/syseventd/daemons/syseventd/syseventd.c | 23 | ||||
| -rw-r--r-- | usr/src/cmd/syseventd/modules/datalink_mod/datalink_mod.c | 14 |
2 files changed, 22 insertions, 15 deletions
diff --git a/usr/src/cmd/syseventd/daemons/syseventd/syseventd.c b/usr/src/cmd/syseventd/daemons/syseventd/syseventd.c index 8e70bfd04d..bd3bc26a2b 100644 --- a/usr/src/cmd/syseventd/daemons/syseventd/syseventd.c +++ b/usr/src/cmd/syseventd/daemons/syseventd/syseventd.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -225,9 +225,12 @@ flt_handler(int sig) (void) se_signal_unblockall(); syseventd_exit(1); /*NOTREACHED*/ + case SIGCLD: + /* No need to abort on a SIGCLD */ + break; default: syseventd_err_print(FATAL_ERROR); - (void) fflush(0); + abort(); } } @@ -309,7 +312,7 @@ main(int argc, char **argv) prog++; } - if ((c = getopt(argc, argv, "d:r:")) != EOF) { + while ((c = getopt(argc, argv, "d:r:")) != EOF) { switch (c) { case 'd': debug_level = atoi(optarg); @@ -691,6 +694,9 @@ client_deliver_event_thr(void *arg) while (eventq != NULL) { d_pkg = eventq->d_pkg; d_pkg->completion_state = SE_OUTSTANDING; + scp->eventq = eventq->next; + free(eventq); + eventq = scp->eventq; (void) mutex_unlock(&scp->client_lock); @@ -767,17 +773,6 @@ client_deliver_event_thr(void *arg) d_pkg->completion_status = error; d_pkg->completion_state = SE_COMPLETE; (void) sema_post(d_pkg->completion_sema); - - /* Update eventq pointer */ - if (scp->eventq != NULL) { - scp->eventq = eventq->next; - free(eventq); - eventq = scp->eventq; - } else { - free(eventq); - break; - } - syseventd_print(3, "Completed delivery with " "error %d\n", error); } diff --git a/usr/src/cmd/syseventd/modules/datalink_mod/datalink_mod.c b/usr/src/cmd/syseventd/modules/datalink_mod/datalink_mod.c index 3a0fcb8af4..72b8a5b7ce 100644 --- a/usr/src/cmd/syseventd/modules/datalink_mod/datalink_mod.c +++ b/usr/src/cmd/syseventd/modules/datalink_mod/datalink_mod.c @@ -36,6 +36,7 @@ #include <libnvpair.h> #include <librcm.h> #include <libsysevent.h> +#include "sysevent_signal.h" extern void syseventd_err_print(char *, ...); @@ -71,15 +72,26 @@ datalink_notify_thread(void *arg) (void) mutex_unlock(&dl_mx); while (tmp_events != NULL) { + struct sigaction cbuf, dfl; + + /* + * Ignore SIGCLD for the + * duration of the rcm_notify_event call. + */ + (void) memset(&dfl, 0, sizeof (dfl)); + dfl.sa_handler = SIG_IGN; + (void) sigaction(SIGCHLD, &dfl, &cbuf); + /* * Send the PHYSLINK_NEW event to network_rcm to update * the network devices cache accordingly. */ if (rcm_notify_event(rcm_hdl, RCM_RESOURCE_PHYSLINK_NEW, 0, tmp_events->ev, NULL) != RCM_SUCCESS) - syseventd_err_print("datalink_mod: Can not" + syseventd_err_print("datalink_mod: Can not " "notify event: %s\n", strerror(errno)); + (void) sigaction(SIGCHLD, &cbuf, NULL); ep = tmp_events; tmp_events = tmp_events->next; nvlist_free(ep->ev); |
