summaryrefslogtreecommitdiff
path: root/usr/src/lib/libsysevent/libsysevent.c
diff options
context:
space:
mode:
authorGavin Maltby <Gavin.Maltby@Sun.COM>2009-11-19 15:28:11 +1100
committerGavin Maltby <Gavin.Maltby@Sun.COM>2009-11-19 15:28:11 +1100
commit49b225e1cfa7bbf7738d4df0a03f18e3283426eb (patch)
treefec8a2ac5f26eef93ef906b43e2642f06bcba3a6 /usr/src/lib/libsysevent/libsysevent.c
parent6dea387a9f9ddc2932a4c49a09384dfdcd5a703b (diff)
downloadillumos-joyent-49b225e1cfa7bbf7738d4df0a03f18e3283426eb.tar.gz
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
PSARC/2009/573 libfmevent - external subscriptions to FMA protocol events PSARC/2009/574 GPEC interface changes and additions 6893144 add door_xcreate for creating private doors with per-door thread creation control 6896220 sysevent_evc_xsubscribe and other GPEC modifications 6900975 sysevent_evc_{unbind,unsubscribe} off-by-one in subscriber list traversal 6868087 facility to allow external processes to subscribe to FMA protocol events 6896205 fmd module to forward selected protocol events for external subscription
Diffstat (limited to 'usr/src/lib/libsysevent/libsysevent.c')
-rw-r--r--usr/src/lib/libsysevent/libsysevent.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/usr/src/lib/libsysevent/libsysevent.c b/usr/src/lib/libsysevent/libsysevent.c
index dc2ebe9858..23cecfd7ad 100644
--- a/usr/src/lib/libsysevent/libsysevent.c
+++ b/usr/src/lib/libsysevent/libsysevent.c
@@ -20,12 +20,10 @@
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
@@ -103,9 +101,9 @@ sysevent_alloc(char *class, int class_sz, char *subclass, int subclass_sz,
aligned_pub_sz = SE_ALIGN(pub_sz);
payload_sz = (aligned_class_sz - sizeof (uint64_t)) +
- (aligned_subclass_sz - sizeof (uint64_t)) +
- (aligned_pub_sz - sizeof (uint64_t)) - sizeof (uint64_t) +
- nvlist_sz;
+ (aligned_subclass_sz - sizeof (uint64_t)) +
+ (aligned_pub_sz - sizeof (uint64_t)) - sizeof (uint64_t) +
+ nvlist_sz;
/*
* Allocate event buffer plus additional payload overhead.
@@ -163,8 +161,7 @@ sysevent_post_event(char *class, char *subclass, char *vendor, char *pub_name,
}
error = modctl(MODEVENTS, (uintptr_t)MODEVENTS_POST_EVENT,
- (uintptr_t)ev, (uintptr_t)SE_SIZE(ev),
- (uintptr_t)eid, 0);
+ (uintptr_t)ev, (uintptr_t)SE_SIZE(ev), (uintptr_t)eid, 0);
sysevent_free(ev);
@@ -692,7 +689,7 @@ se_print(FILE *fp, sysevent_t *ev)
(void) sysevent_get_time(ev, &hrt);
(void) fprintf(fp, "received sysevent id = 0X%llx:%llx\n",
- hrt, (longlong_t)sysevent_get_seq(ev));
+ hrt, (longlong_t)sysevent_get_seq(ev));
(void) fprintf(fp, "\tclass = %s\n", sysevent_get_class_name(ev));
(void) fprintf(fp, "\tsubclass = %s\n", sysevent_get_subclass_name(ev));
if ((vendor = sysevent_get_vendor_name(ev)) != NULL) {
@@ -807,6 +804,7 @@ struct reg_args {
* is called in response to a door call to post an event.
*
*/
+/*ARGSUSED*/
static void
event_deliver_service(void *cookie, char *args, size_t alen,
door_desc_t *ddp, uint_t ndid)
@@ -1087,6 +1085,7 @@ dealloc_subscribers(sysevent_handle_t *shp)
}
}
+/*ARGSUSED*/
static int
alloc_subscriber(sysevent_handle_t *shp, uint32_t sub_id, int oflag)
{
@@ -1470,6 +1469,7 @@ create_failed:
* is called in response to a registration cache update.
*
*/
+/*ARGSUSED*/
static void
cache_update_service(void *cookie, char *args, size_t alen,
door_desc_t *ddp, uint_t ndid)
@@ -1490,6 +1490,7 @@ cache_update_service(void *cookie, char *args, size_t alen,
goto return_from_door;
}
+ /* LINTED: E_BAD_PTR_CAST_ALIGN */
rargs = (struct reg_args *)args;
shp = (sysevent_handle_t *)cookie;
@@ -1833,8 +1834,8 @@ sysevent_open_channel(const char *channel)
while (getextmntent(fp, &m, sizeof (struct extmnttab)) == 0) {
if (strcmp(m.mnt_mountp, "/var/run") == 0 &&
- strcmp(m.mnt_fstype, "tmpfs") == 0) {
- (void) fclose(fp);
+ strcmp(m.mnt_fstype, "tmpfs") == 0) {
+ (void) fclose(fp);
var_run_mounted = 1;
break;
}
@@ -2127,7 +2128,7 @@ sysevent_bind_subscriber(sysevent_handle_t *shp,
if ((SH_DOOR_DESC(shp) = door_create(event_deliver_service,
(void *)shp, DOOR_REFUSE_DESC | DOOR_NO_CANCEL)) == -1) {
dprint("sysevent_bind_subscriber: door create failed: "
- "%s\n", strerror(errno));
+ "%s\n", strerror(errno));
error = EFAULT;
goto fail;
}
@@ -2154,7 +2155,7 @@ sysevent_bind_subscriber(sysevent_handle_t *shp,
/* Create an event handler thread */
if (thr_create(NULL, NULL, (void *(*)(void *))subscriber_event_handler,
- shp, THR_BOUND, &sub_info->sp_handler_tid) != 0) {
+ shp, THR_BOUND, &sub_info->sp_handler_tid) != 0) {
error = EFAULT;
goto fail;
}