Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[udev] Fix udev iowatch issues
The io watch source id is not cleared when it is going to be implicitly
removed - which can lead to unsuccessful removal attempt when/if
hwal_cleanup() function is called later on.

Clear watch_id when return value from the callback function is going
to cause it to be implicitly removed.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Jul 7, 2016
1 parent 7bc4498 commit 6ec3a73
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/usb_moded-udev.c
Expand Up @@ -264,8 +264,9 @@ static gboolean monitor_udev(GIOChannel *iochannel G_GNUC_UNUSED, GIOCondition c

release_wakelock(USB_MODED_WAKELOCK_PROCESS_INPUT);

if (!continue_watching)
if (!continue_watching && watch_id )
{
watch_id = 0;
log_crit("udev io watch disabled");
}

Expand Down

0 comments on commit 6ec3a73

Please sign in to comment.