Skip to content

Commit

Permalink
Cleaner signalling when changing profiles to have less disconnect ban…
Browse files Browse the repository at this point in the history
…ners + update killer message

Signed-off-by: Philippe De Swert <philippedeswert@gmail.com>
  • Loading branch information
philippedeswert committed Sep 11, 2012
1 parent 215538f commit 36251d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/usb_moded-dbus.h
Expand Up @@ -39,6 +39,7 @@
/* state definitions for signals and method parameters */
#define USB_CONNECTED "USB connected"
#define USB_DISCONNECTED "USB disconnected"
#define USB_REALLY_DISCONNECT "USB mode change in progress"
#define DATA_IN_USE "data_in_use"
#define USB_CONNECTED_DIALOG_SHOW "mode_requested_show_dialog"
#define USB_PRE_UNMOUNT "pre-unmount"
Expand Down
6 changes: 3 additions & 3 deletions src/usb_moded-modules.c
Expand Up @@ -176,8 +176,8 @@ int usb_moded_module_cleanup(const char *module)
// SP: up to 2 second sleep -> worth a warning log?
/* module did not get unloaded. We will wait a bit and try again */
sleep(1);
/* send another disconnect message */
usb_moded_send_signal(USB_DISCONNECTED);
/* send the REALLY disconnect message */
usb_moded_send_signal(USB_REALLY_DISCONNECT);
failure = usb_moded_unload_module(module);
log_debug("unloading failure = %d\n", failure);
if(!failure)
Expand All @@ -196,7 +196,7 @@ int usb_moded_module_cleanup(const char *module)
lets go for more extreme measures
lsof, then various options of kill
*/
log_info("DIE DIE DIE! Free USB-illy!\n");
log_info("Oh noes the platform is on fire!\n");
kill:
/* DIRTY DESPERATE WORKAROUND */
/*system("for i in `lsof -t /dev/ttyGS*`; do cat /proc/$i/cmdline | sed 's/|//g' | sed "s/\x00/ /g" | awk '{ print $1 }' | xargs kill; done");
Expand Down

0 comments on commit 36251d1

Please sign in to comment.