Hi Leena,
On Tue, Nov 23, 2010 at 01:19:18PM +0530, [email protected] wrote:
> Below is patch for:
> http://bugs.meego.com/show_bug.cgi?id=10330
The bug is valid, yes.
> --- a/src/technology.c
> +++ b/src/technology.c
> @@ -675,7 +675,8 @@ int __connman_technology_update_rfkill(unsigned int index,
> technology->state = CONNMAN_TECHNOLOGY_STATE_BLOCKED;
> state_changed(technology);
> } else {
> - if (g_atomic_int_dec_and_test(&technology->blocked) == FALSE)
> + if (g_atomic_int_get(&technology->blocked) == 0 ||
> + g_atomic_int_dec_and_test(&technology->blocked)
> == FALSE)
> return 0;
So here we're decreasing the technology blocked refcount if the technology is
blocked. What we want is decreasing it if the updated rfkill device was
actually rfkilled. And in fact we already do that by checking that old_blocked
!= blocked.
> technology_blocked(technology, blocked);
> @@ -700,7 +701,8 @@ int __connman_technology_remove_rfkill(unsigned int index)
>
> g_hash_table_remove(rfkill_table, &index);
>
> - if (g_atomic_int_dec_and_test(&technology->blocked) == TRUE) {
> + if (g_atomic_int_get(&technology->blocked) &&
> + g_atomic_int_dec_and_test(&technology->blocked) ==
> TRUE) {
>
Same thing here: We should decrease the refcount if the removed rfkill device
was rfkilled. We're currently not handling that, and I just pushed a patch
for that. Can you see if it fixes the bug for you as well ?
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman