[PATCH] ModemManager: handle "change" uevents as well as "add"

The udev strategy used by ModemManager, as expressed in
80-mm-candidate.rules, expects "add" events to be emitted at startup
when device rules have been processed (said events usually being
generated by "udevadm trigger"). However, since udev-152, "udevadm
trigger" generates "change" events instead. It's possible for distros
or startup scripts to work around this, but I suggest we should just
go ahead and accept these events as-is.

    - Nathan
From 4d51ee9ff7762d089fc85cb078c6a46bed0b6160 Mon Sep 17 00:00:00 2001
From: Nathan Williams <njw google com>
Date: Wed, 8 Jun 2011 15:52:08 -0400
Subject: [PATCH] handle_uevent(): Handle "change" events as well as "add", since that's
 what the udev replay gives us these days (as of udev-152).

Change-Id: I5b194d72d8f46ac235748f183314a7c8e0393907
 src/mm-manager.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/mm-manager.c b/src/mm-manager.c
index 561d427..cde0747 100644
--- a/src/mm-manager.c
+++ b/src/mm-manager.c
@@ -909,7 +909,8 @@ handle_uevent (GUdevClient *client,
 	/* We only care about tty/net devices when adding modem ports,
 	 * but for remove, also handle usb parent device remove events
-	if ((!strcmp (action, "add") || !strcmp (action, "move")) && strcmp (subsys, "usb") !=0 )
+	if ((!strcmp (action, "add") || !strcmp (action, "move") !strcmp (action, "change")) 
+        && strcmp (subsys, "usb") !=0 )
 		device_added (self, device);
 	else if (!strcmp (action, "remove"))
 		device_removed (self, device);

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]