6729456 fp-scrubber doesn't work in fmsim environment
authoria112686
Fri, 01 Aug 2008 10:33:09 -0700
changeset 7251 b7bb6b75db90
parent 7250 38da31a10e9f
child 7252 1a0a49343380
6729456 fp-scrubber doesn't work in fmsim environment
usr/src/cmd/fm/modules/sun4u/fps-transport/fps-transport.c
--- a/usr/src/cmd/fm/modules/sun4u/fps-transport/fps-transport.c	Fri Aug 01 05:15:07 2008 -0700
+++ b/usr/src/cmd/fm/modules/sun4u/fps-transport/fps-transport.c	Fri Aug 01 10:33:09 2008 -0700
@@ -139,6 +139,8 @@
 void
 _fmd_init(fmd_hdl_t *hdl)
 {
+	int ret = 0;
+
 	if (fmd_hdl_register(hdl, FMD_API_VERSION, &fmd_info) != 0) {
 		return;
 	}
@@ -154,10 +156,15 @@
 		fmd_hdl_unregister(hdl);
 	}
 
-	if (sysevent_evc_subscribe(h_event, SUBSCRIBE_ID, SUBSCRIBE_FLAGS,
-	    event_transfer, NULL, 0) != 0) {
-		fmd_hdl_error(hdl, "Failed to subsrcibe to channel %s",
-		    CHANNEL);
-		fmd_hdl_unregister(hdl);
+	ret = sysevent_evc_subscribe(h_event, SUBSCRIBE_ID,
+	    SUBSCRIBE_FLAGS, event_transfer, NULL, 0);
+	if (ret != 0) {
+		if (ret == EEXIST) {
+			fmd_hdl_unregister(hdl);
+		} else {
+			fmd_hdl_error(hdl,
+			    "Failed to subsrcibe to channel %s", CHANNEL);
+			fmd_hdl_unregister(hdl);
+		}
 	}
 }