hal/hald/linux2 acpi.c, 1.18, 1.19 apm.c, 1.6, 1.7 blockdev.c, 1.14, 1.15 classdev.c, 1.23, 1.24 coldplug.c, 1.13, 1.14 hotplug.c, 1.15, 1.16 hotplug.h, 1.7, 1.8 osspec.c, 1.22, 1.23 physdev.c, 1.11, 1.12 pmu.c, 1.8, 1.9

Kay Sievers kay at freedesktop.org
Wed Mar 16 12:09:49 PST 2005


Update of /cvs/hal/hal/hald/linux2
In directory gabe:/tmp/cvs-serv352/hald/linux2

Modified Files:
	acpi.c apm.c blockdev.c classdev.c coldplug.c hotplug.c 
	hotplug.h osspec.c physdev.c pmu.c 
Log Message:
2005-03-16  Kay Sievers  <kay.sievers at vrfy.org>

        Replace boolean action type of hotplug event with enum, cause
        hotplug actions are not limited to "add" and "remove" events. The
        kernel already emits "online", "offline" hotplug events for
        hotplugging cpu's.

        * hald/linux2/acpi.c: (acpi_synthesize),
        (acpi_generate_add_hotplug_event),
        (acpi_generate_remove_hotplug_event):

        * hald/linux2/apm.c: (apm_synthesize_hotplug_events),
        (apm_generate_add_hotplug_event),
        (apm_generate_remove_hotplug_event):

        * hald/linux2/blockdev.c:
        (generate_fakevolume_hotplug_event_add_for_storage_device),
        (blockdev_generate_add_hotplug_event),
        (blockdev_generate_remove_hotplug_event):

        * hald/linux2/classdev.c: (classdev_generate_add_hotplug_event),
        (classdev_generate_remove_hotplug_event):

        * hald/linux2/coldplug.c: (coldplug_synthesize_events),
        (coldplug_synthesize_block_event), (coldplug_compute_visit_device):

        * hald/linux2/hotplug.c: (hotplug_event_begin_sysfs),
        (hotplug_event_begin_acpi), (hotplug_event_begin_apm),
        (hotplug_event_begin_pmu):

        * hald/linux2/hotplug.h:

        * hald/linux2/osspec.c: (hald_helper_data):

        * hald/linux2/physdev.c: (physdev_generate_add_hotplug_event),
        (physdev_generate_remove_hotplug_event):

        * hald/linux2/pmu.c: (pmu_synthesize_hotplug_events),
        (pmu_generate_add_hotplug_event),
        (pmu_generate_remove_hotplug_event):



Index: acpi.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/acpi.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- acpi.c	10 Mar 2005 20:17:20 -0000	1.18
+++ acpi.c	16 Mar 2005 20:09:47 -0000	1.19
@@ -254,7 +254,7 @@
 		HAL_INFO (("Processing %s", buf));
 
 		hotplug_event = g_new0 (HotplugEvent, 1);
-		hotplug_event->is_add = TRUE;
+		hotplug_event->action = HOTPLUG_ACTION_ADD;
 		hotplug_event->type = HOTPLUG_EVENT_ACPI;
 		g_strlcpy (hotplug_event->acpi.acpi_path, buf, sizeof (hotplug_event->acpi.acpi_path));
 		hotplug_event->acpi.acpi_type = acpi_type;
@@ -593,7 +593,7 @@
 	acpi_type = hal_device_property_get_int (d, "linux.acpi_type");
 
 	hotplug_event = g_new0 (HotplugEvent, 1);
-	hotplug_event->is_add = TRUE;
+	hotplug_event->action = HOTPLUG_ACTION_ADD;
 	hotplug_event->type = HOTPLUG_EVENT_ACPI;
 	g_strlcpy (hotplug_event->acpi.acpi_path, acpi_path, sizeof (hotplug_event->acpi.acpi_path));
 	hotplug_event->acpi.acpi_type = acpi_type;
@@ -611,7 +611,7 @@
 	acpi_type = hal_device_property_get_int (d, "linux.acpi_type");
 
 	hotplug_event = g_new0 (HotplugEvent, 1);
-	hotplug_event->is_add = FALSE;
+	hotplug_event->action = HOTPLUG_ACTION_REMOVE;
 	hotplug_event->type = HOTPLUG_EVENT_ACPI;
 	g_strlcpy (hotplug_event->acpi.acpi_path, acpi_path, sizeof (hotplug_event->acpi.acpi_path));
 	hotplug_event->acpi.acpi_type = acpi_type;

Index: apm.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/apm.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- apm.c	2 Mar 2005 21:51:55 -0000	1.6
+++ apm.c	16 Mar 2005 20:09:47 -0000	1.7
@@ -218,14 +218,13 @@
 	snprintf (path, sizeof (path), "%s/apm", get_hal_proc_path ());
 
 	hotplug_event = g_new0 (HotplugEvent, 1);
-	hotplug_event->is_add = TRUE;
+	hotplug_event->action = HOTPLUG_ACTION_ADD;
 	hotplug_event->type = HOTPLUG_EVENT_APM;
 	g_strlcpy (hotplug_event->apm.apm_path, path, sizeof (hotplug_event->apm.apm_path));
 	hotplug_event->apm.apm_type = APM_TYPE_BATTERY;
 	hotplug_event_enqueue (hotplug_event);
 
 	hotplug_event = g_new0 (HotplugEvent, 1);
-	hotplug_event->is_add = TRUE;
 	hotplug_event->type = HOTPLUG_EVENT_APM;
 	g_strlcpy (hotplug_event->apm.apm_path, path, sizeof (hotplug_event->apm.apm_path));
 	hotplug_event->apm.apm_type = APM_TYPE_AC_ADAPTER;
@@ -421,7 +420,7 @@
 	apm_type = hal_device_property_get_int (d, "linux.apm_type");
 
 	hotplug_event = g_new0 (HotplugEvent, 1);
-	hotplug_event->is_add = TRUE;
+	hotplug_event->action = HOTPLUG_ACTION_ADD;
 	hotplug_event->type = HOTPLUG_EVENT_APM;
 	g_strlcpy (hotplug_event->apm.apm_path, apm_path, sizeof (hotplug_event->apm.apm_path));
 	hotplug_event->apm.apm_type = apm_type;
@@ -439,7 +438,7 @@
 	apm_type = hal_device_property_get_int (d, "linux.apm_type");
 
 	hotplug_event = g_new0 (HotplugEvent, 1);
-	hotplug_event->is_add = FALSE;
+	hotplug_event->action = HOTPLUG_ACTION_REMOVE;
 	hotplug_event->type = HOTPLUG_EVENT_APM;
 	g_strlcpy (hotplug_event->apm.apm_path, apm_path, sizeof (hotplug_event->apm.apm_path));
 	hotplug_event->apm.apm_type = apm_type;

Index: blockdev.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/blockdev.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- blockdev.c	15 Mar 2005 05:47:43 -0000	1.14
+++ blockdev.c	16 Mar 2005 20:09:47 -0000	1.15
@@ -241,7 +241,7 @@
 	snprintf (fake_sysfs_path, sizeof(fake_sysfs_path), "%s/fakevolume", sysfs_path);
 
 	hotplug_event = g_new0 (HotplugEvent, 1);
-	hotplug_event->is_add = TRUE;
+	hotplug_event->action = HOTPLUG_ACTION_ADD;
 	hotplug_event->type = HOTPLUG_EVENT_SYSFS;
 	g_strlcpy (hotplug_event->sysfs.subsystem, "block", sizeof (hotplug_event->sysfs.subsystem));
 	g_strlcpy (hotplug_event->sysfs.sysfs_path, fake_sysfs_path, sizeof (hotplug_event->sysfs.sysfs_path));
@@ -1222,7 +1222,7 @@
 	device_file = hal_device_property_get_string (d, "block.device");
 
 	hotplug_event = g_new0 (HotplugEvent, 1);
-	hotplug_event->is_add = TRUE;
+	hotplug_event->action = HOTPLUG_ACTION_ADD;
 	hotplug_event->type = HOTPLUG_EVENT_SYSFS;
 	g_strlcpy (hotplug_event->sysfs.subsystem, "block", sizeof (hotplug_event->sysfs.subsystem));
 	g_strlcpy (hotplug_event->sysfs.sysfs_path, sysfs_path, sizeof (hotplug_event->sysfs.sysfs_path));
@@ -1244,7 +1244,7 @@
 	sysfs_path = hal_device_property_get_string (d, "linux.sysfs_path");
 
 	hotplug_event = g_new0 (HotplugEvent, 1);
-	hotplug_event->is_add = FALSE;
+	hotplug_event->action = HOTPLUG_ACTION_REMOVE;
 	hotplug_event->type = HOTPLUG_EVENT_SYSFS;
 	g_strlcpy (hotplug_event->sysfs.subsystem, "block", sizeof (hotplug_event->sysfs.subsystem));
 	g_strlcpy (hotplug_event->sysfs.sysfs_path, sysfs_path, sizeof (hotplug_event->sysfs.sysfs_path));

Index: classdev.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/classdev.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- classdev.c	16 Mar 2005 02:58:02 -0000	1.23
+++ classdev.c	16 Mar 2005 20:09:47 -0000	1.24
@@ -987,7 +987,7 @@
 	device_file = hal_device_property_get_string (d, "linux.device_file");
 
 	hotplug_event = g_new0 (HotplugEvent, 1);
-	hotplug_event->is_add = TRUE;
+	hotplug_event->action = HOTPLUG_ACTION_ADD;
 	hotplug_event->type = HOTPLUG_EVENT_SYSFS;
 	g_strlcpy (hotplug_event->sysfs.subsystem, subsystem, sizeof (hotplug_event->sysfs.subsystem));
 	g_strlcpy (hotplug_event->sysfs.sysfs_path, sysfs_path, sizeof (hotplug_event->sysfs.sysfs_path));
@@ -1011,7 +1011,7 @@
 	sysfs_path = hal_device_property_get_string (d, "linux.sysfs_path");
 
 	hotplug_event = g_new0 (HotplugEvent, 1);
-	hotplug_event->is_add = FALSE;
+	hotplug_event->action = HOTPLUG_ACTION_REMOVE;
 	hotplug_event->type = HOTPLUG_EVENT_SYSFS;
 	g_strlcpy (hotplug_event->sysfs.subsystem, subsystem, sizeof (hotplug_event->sysfs.subsystem));
 	g_strlcpy (hotplug_event->sysfs.sysfs_path, sysfs_path, sizeof (hotplug_event->sysfs.sysfs_path));

Index: coldplug.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/coldplug.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- coldplug.c	15 Mar 2005 05:47:43 -0000	1.13
+++ coldplug.c	16 Mar 2005 20:09:47 -0000	1.14
@@ -295,7 +295,7 @@
 		printf ("class: %s (%s) (no device link)\n", sysfs_path, subsystem);
 #endif
 		hotplug_event = g_new0 (HotplugEvent, 1);
-		hotplug_event->is_add = TRUE;
+		hotplug_event->action = HOTPLUG_ACTION_ADD;
 		hotplug_event->type = HOTPLUG_EVENT_SYSFS;
 		g_strlcpy (hotplug_event->sysfs.subsystem, subsystem, sizeof (hotplug_event->sysfs.subsystem));
 		g_strlcpy (hotplug_event->sysfs.sysfs_path, sysfs_path, sizeof (hotplug_event->sysfs.sysfs_path));
@@ -367,7 +367,7 @@
 	}
 
 	hotplug_event = g_new0 (HotplugEvent, 1);
-	hotplug_event->is_add = TRUE;
+	hotplug_event->action = HOTPLUG_ACTION_ADD;
 	hotplug_event->type = HOTPLUG_EVENT_SYSFS;
 	g_strlcpy (hotplug_event->sysfs.subsystem, "block", sizeof (hotplug_event->sysfs.subsystem));
 	g_strlcpy (hotplug_event->sysfs.sysfs_path, path, sizeof (hotplug_event->sysfs.sysfs_path));
@@ -395,7 +395,7 @@
 #endif
 
 			hotplug_event = g_new0 (HotplugEvent, 1);
-			hotplug_event->is_add = TRUE;
+			hotplug_event->action = HOTPLUG_ACTION_ADD;
 			hotplug_event->type = HOTPLUG_EVENT_SYSFS;
 			g_strlcpy (hotplug_event->sysfs.subsystem, "block", sizeof (hotplug_event->sysfs.subsystem));
 			g_strlcpy (hotplug_event->sysfs.sysfs_path, path1, sizeof (hotplug_event->sysfs.sysfs_path));
@@ -436,7 +436,7 @@
 #endif
 
 		hotplug_event = g_new0 (HotplugEvent, 1);
-		hotplug_event->is_add = TRUE;
+		hotplug_event->action = HOTPLUG_ACTION_ADD;
 		hotplug_event->type = HOTPLUG_EVENT_SYSFS;
 		g_strlcpy (hotplug_event->sysfs.subsystem, bus, sizeof (hotplug_event->sysfs.subsystem));
 		g_strlcpy (hotplug_event->sysfs.sysfs_path, path, sizeof (hotplug_event->sysfs.sysfs_path));
@@ -464,7 +464,7 @@
 		printf ("class: %s (%s) (%s)\n", path, subsystem, sysfs_path);
 #endif
 		hotplug_event = g_new0 (HotplugEvent, 1);
-		hotplug_event->is_add = TRUE;
+		hotplug_event->action = HOTPLUG_ACTION_ADD;
 		hotplug_event->type = HOTPLUG_EVENT_SYSFS;
 		g_strlcpy (hotplug_event->sysfs.subsystem, subsystem, sizeof (hotplug_event->sysfs.subsystem));
 		g_strlcpy (hotplug_event->sysfs.sysfs_path, sysfs_path, sizeof (hotplug_event->sysfs.sysfs_path));

Index: hotplug.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/hotplug.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- hotplug.c	15 Mar 2005 21:10:06 -0000	1.15
+++ hotplug.c	16 Mar 2005 20:09:47 -0000	1.16
@@ -146,29 +146,30 @@
 		sys_block_path_len   = g_snprintf (sys_block_path, HAL_PATH_MAX, "%s/block", get_hal_sysfs_path ());
 	}
 
-	if (hotplug_event->is_add && hal_device_store_match_key_value_string (hald_get_gdl (),
-									      "linux.sysfs_path",
-									      hotplug_event->sysfs.sysfs_path)) {
+	if (hotplug_event->action == HOTPLUG_ACTION_ADD &&
+	    hal_device_store_match_key_value_string (hald_get_gdl (),
+						     "linux.sysfs_path",
+						     hotplug_event->sysfs.sysfs_path)) {
 		HAL_ERROR (("devpath %s already present in the store, ignore event", hotplug_event->sysfs.sysfs_path));
 		hotplug_event_end ((void *) hotplug_event);
 		return;
 	}
 
-	if (strncmp (hotplug_event->sysfs.sysfs_path, sys_devices_path, sys_devices_path_len) == 0) {		
-		if (hotplug_event->is_add) {
+	if (strncmp (hotplug_event->sysfs.sysfs_path, sys_devices_path, sys_devices_path_len) == 0) {
+		if (hotplug_event->action == HOTPLUG_ACTION_ADD) {
 			HalDevice *parent;
 			parent = hal_util_find_closest_ancestor (hotplug_event->sysfs.sysfs_path);
 			hotplug_event_begin_add_physdev (hotplug_event->sysfs.subsystem, 
 							 hotplug_event->sysfs.sysfs_path, 
 							 parent,
 							 (void *) hotplug_event);
-		} else {
+		} else if (hotplug_event->action == HOTPLUG_ACTION_REMOVE) {
 			hotplug_event_begin_remove_physdev (hotplug_event->sysfs.subsystem, 
 							    hotplug_event->sysfs.sysfs_path, 
 							    (void *) hotplug_event);
 		}
 	} else if (strncmp (hotplug_event->sysfs.sysfs_path, sys_class_path, sys_class_path_len) == 0) {
-		if (hotplug_event->is_add) {
+		if (hotplug_event->action == HOTPLUG_ACTION_ADD) {
 			gchar *target;
 			HalDevice *physdev;
 			char physdevpath[256];
@@ -218,7 +219,7 @@
 
 			g_free (sysfs_path_in_devices);
 
-		} else {
+		} else if (hotplug_event->action == HOTPLUG_ACTION_REMOVE) {
 			hotplug_event_begin_remove_classdev (hotplug_event->sysfs.subsystem,
 							     hotplug_event->sysfs.sysfs_path,
 							     (void *) hotplug_event);
@@ -230,7 +231,7 @@
 		parent_path = hal_util_get_parent_path (hotplug_event->sysfs.sysfs_path);
 		is_partition = (strcmp (parent_path, sys_block_path) != 0);
 		
-		if (hotplug_event->is_add) {
+		if (hotplug_event->action == HOTPLUG_ACTION_ADD) {
 			HalDevice *parent;
 
 			if (is_partition) {
@@ -261,7 +262,7 @@
 							  is_partition,
 							  parent,
 							  (void *) hotplug_event);
-		} else {
+		} else if (hotplug_event->action == HOTPLUG_ACTION_REMOVE) {
 			hotplug_event_begin_remove_blockdev (hotplug_event->sysfs.sysfs_path,
 							     is_partition,
 							     (void *) hotplug_event);
@@ -277,12 +278,12 @@
 static void
 hotplug_event_begin_acpi (HotplugEvent *hotplug_event)
 {
-	if (hotplug_event->is_add) {
+	if (hotplug_event->action == HOTPLUG_ACTION_ADD) {
 		hotplug_event_begin_add_acpi (hotplug_event->acpi.acpi_path, 
 					      hotplug_event->acpi.acpi_type,
 					      NULL,
 					      (void *) hotplug_event);
-	} else {
+	} else if (hotplug_event->action == HOTPLUG_ACTION_REMOVE) {
 		hotplug_event_begin_remove_acpi (hotplug_event->acpi.acpi_path, 
 						 hotplug_event->acpi.acpi_type,
 						 (void *) hotplug_event);
@@ -292,12 +293,12 @@
 static void
 hotplug_event_begin_apm (HotplugEvent *hotplug_event)
 {
-	if (hotplug_event->is_add) {
+	if (hotplug_event->action == HOTPLUG_ACTION_ADD) {
 		hotplug_event_begin_add_apm (hotplug_event->apm.apm_path, 
 					     hotplug_event->apm.apm_type,
 					     NULL,
 					     (void *) hotplug_event);
-	} else {
+	} else if (hotplug_event->action == HOTPLUG_ACTION_REMOVE) {
 		hotplug_event_begin_remove_apm (hotplug_event->apm.apm_path, 
 						hotplug_event->apm.apm_type,
 						(void *) hotplug_event);
@@ -307,12 +308,12 @@
 static void
 hotplug_event_begin_pmu (HotplugEvent *hotplug_event)
 {
-	if (hotplug_event->is_add) {
+	if (hotplug_event->action == HOTPLUG_ACTION_ADD) {
 		hotplug_event_begin_add_pmu (hotplug_event->pmu.pmu_path, 
 					     hotplug_event->pmu.pmu_type,
 					     NULL,
 					     (void *) hotplug_event);
-	} else {
+	} else if (hotplug_event->action == HOTPLUG_ACTION_REMOVE) {
 		hotplug_event_begin_remove_pmu (hotplug_event->pmu.pmu_path, 
 						hotplug_event->pmu.pmu_type,
 						(void *) hotplug_event);

Index: hotplug.h
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/hotplug.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- hotplug.h	25 Feb 2005 03:32:48 -0000	1.7
+++ hotplug.h	16 Mar 2005 20:09:47 -0000	1.8
@@ -32,6 +32,13 @@
 #include "../util.h"
 
 typedef enum {
+	HOTPLUG_ACTION_ADD,
+	HOTPLUG_ACTION_REMOVE,
+	HOTPLUG_ACTION_ONLINE,
+	HOTPLUG_ACTION_OFFLINE,
+} HotplugActionType;
+
+typedef enum {
 	HOTPLUG_EVENT_SYSFS       = 0,
 	HOTPLUG_EVENT_SYSFS_BUS   = 1,
 	HOTPLUG_EVENT_SYSFS_CLASS = 2,
@@ -46,8 +53,7 @@
  */
 typedef struct
 {
-	gboolean is_add;                        /**< Whether the event is add or remove */
-
+	HotplugActionType action;               /**< Whether the event is add or remove */
 	HotplugEventType type;                  /**< Type of hotplug event */
 
 	union {

Index: osspec.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/osspec.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- osspec.c	13 Mar 2005 01:48:24 -0000	1.22
+++ osspec.c	16 Mar 2005 20:09:47 -0000	1.23
@@ -157,7 +157,7 @@
 		HotplugEvent *hotplug_event;
 
 		hotplug_event = g_new0 (HotplugEvent, 1);
-		hotplug_event->is_add = TRUE;
+		hotplug_event->action = HOTPLUG_ACTION_ADD;
 		hotplug_event->type = HOTPLUG_EVENT_SYSFS;
 		g_strlcpy (hotplug_event->sysfs.subsystem, msg.subsystem, sizeof (hotplug_event->sysfs.subsystem));
 		g_snprintf (hotplug_event->sysfs.sysfs_path, sizeof (hotplug_event->sysfs.sysfs_path), "%s%s", 
@@ -174,7 +174,7 @@
 		HotplugEvent *hotplug_event;
 
 		hotplug_event = g_new0 (HotplugEvent, 1);
-		hotplug_event->is_add = FALSE;
+		hotplug_event->action = HOTPLUG_ACTION_REMOVE;
 		hotplug_event->type = HOTPLUG_EVENT_SYSFS;
 		g_strlcpy (hotplug_event->sysfs.subsystem, msg.subsystem, sizeof (hotplug_event->sysfs.subsystem));
 		g_snprintf (hotplug_event->sysfs.sysfs_path, sizeof (hotplug_event->sysfs.sysfs_path), "%s%s", 

Index: physdev.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/physdev.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- physdev.c	15 Mar 2005 21:10:06 -0000	1.11
+++ physdev.c	16 Mar 2005 20:09:47 -0000	1.12
@@ -1004,7 +1004,7 @@
 	sysfs_path = hal_device_property_get_string (d, "linux.sysfs_path");
 
 	hotplug_event = g_new0 (HotplugEvent, 1);
-	hotplug_event->is_add = TRUE;
+	hotplug_event->action = HOTPLUG_ACTION_ADD;
 	hotplug_event->type = HOTPLUG_EVENT_SYSFS;
 	g_strlcpy (hotplug_event->sysfs.subsystem, subsystem, sizeof (hotplug_event->sysfs.subsystem));
 	g_strlcpy (hotplug_event->sysfs.sysfs_path, sysfs_path, sizeof (hotplug_event->sysfs.sysfs_path));
@@ -1025,7 +1025,7 @@
 	sysfs_path = hal_device_property_get_string (d, "linux.sysfs_path");
 
 	hotplug_event = g_new0 (HotplugEvent, 1);
-	hotplug_event->is_add = FALSE;
+	hotplug_event->action = HOTPLUG_ACTION_REMOVE;
 	hotplug_event->type = HOTPLUG_EVENT_SYSFS;
 	g_strlcpy (hotplug_event->sysfs.subsystem, subsystem, sizeof (hotplug_event->sysfs.subsystem));
 	g_strlcpy (hotplug_event->sysfs.sysfs_path, sysfs_path, sizeof (hotplug_event->sysfs.sysfs_path));

Index: pmu.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/pmu.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- pmu.c	7 Mar 2005 19:08:41 -0000	1.8
+++ pmu.c	16 Mar 2005 20:09:47 -0000	1.9
@@ -172,7 +172,7 @@
 	/* AC Adapter */
 	snprintf (path, sizeof (path), "%s/pmu/info", get_hal_proc_path ());
 	hotplug_event = g_new0 (HotplugEvent, 1);
-	hotplug_event->is_add = TRUE;
+	hotplug_event->action = HOTPLUG_ACTION_ADD;
 	hotplug_event->type = HOTPLUG_EVENT_PMU;
 	g_strlcpy (hotplug_event->pmu.pmu_path, path, sizeof (hotplug_event->pmu.pmu_path));
 	hotplug_event->pmu.pmu_type = PMU_TYPE_AC_ADAPTER;
@@ -194,7 +194,7 @@
 				HAL_INFO (("Processing %s", buf));
 				
 				hotplug_event = g_new0 (HotplugEvent, 1);
-				hotplug_event->is_add = TRUE;
+				hotplug_event->action = HOTPLUG_ACTION_ADD;
 				hotplug_event->type = HOTPLUG_EVENT_PMU;
 				g_strlcpy (hotplug_event->pmu.pmu_path, buf, sizeof (hotplug_event->pmu.pmu_path));
 				hotplug_event->pmu.pmu_type = PMU_TYPE_BATTERY;
@@ -402,7 +402,7 @@
 	pmu_type = hal_device_property_get_int (d, "linux.pmu_type");
 
 	hotplug_event = g_new0 (HotplugEvent, 1);
-	hotplug_event->is_add = TRUE;
+	hotplug_event->action = HOTPLUG_ACTION_ADD;
 	hotplug_event->type = HOTPLUG_EVENT_PMU;
 	g_strlcpy (hotplug_event->pmu.pmu_path, pmu_path, sizeof (hotplug_event->pmu.pmu_path));
 	hotplug_event->pmu.pmu_type = pmu_type;
@@ -420,7 +420,7 @@
 	pmu_type = hal_device_property_get_int (d, "linux.pmu_type");
 
 	hotplug_event = g_new0 (HotplugEvent, 1);
-	hotplug_event->is_add = FALSE;
+	hotplug_event->action = HOTPLUG_ACTION_REMOVE;
 	hotplug_event->type = HOTPLUG_EVENT_PMU;
 	g_strlcpy (hotplug_event->pmu.pmu_path, pmu_path, sizeof (hotplug_event->pmu.pmu_path));
 	hotplug_event->pmu.pmu_type = pmu_type;




More information about the hal-commit mailing list