diff options
author | Yu A Wang <arron.wang@intel.com> | 2011-12-08 02:31:05 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-12-16 19:48:17 +0100 |
commit | 83a6923af0156de7575fac4bfb0ad2ee5023b361 (patch) | |
tree | 8f1e6be9715dcb0729fb38967e79de6014518bd4 | |
parent | 82e0927004c06a108ad31b72a41e674a2462fede (diff) | |
download | connman-83a6923af0156de7575fac4bfb0ad2ee5023b361.tar.gz connman-83a6923af0156de7575fac4bfb0ad2ee5023b361.tar.bz2 connman-83a6923af0156de7575fac4bfb0ad2ee5023b361.zip |
gdhcp: Check listerner_watch before remove it
Fixed following error:
connmand[4547]: src/dhcp.c:dhcp_release() dhcp 0x8c6d3e8
connmand[4547]: DHCP: switch listening mode (3 ==> 0)
(connmand:4547): GLib-CRITICAL **: g_source_remove: assertion `tag > 0' failed
-rw-r--r-- | gdhcp/client.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gdhcp/client.c b/gdhcp/client.c index 32703465..6df32815 100644 --- a/gdhcp/client.c +++ b/gdhcp/client.c @@ -777,7 +777,8 @@ static int switch_listening_mode(GDHCPClient *dhcp_client, return 0; if (dhcp_client->listen_mode != L_NONE) { - g_source_remove(dhcp_client->listener_watch); + if (dhcp_client->listener_watch > 0) + g_source_remove(dhcp_client->listener_watch); dhcp_client->listener_channel = NULL; dhcp_client->listen_mode = L_NONE; dhcp_client->listener_sockfd = -1; |