summaryrefslogtreecommitdiff
path: root/gdhcp
diff options
context:
space:
mode:
authorYu A Wang <arron.wang@intel.com>2011-12-08 07:31:05 (GMT)
committerSamuel Ortiz <sameo@linux.intel.com>2011-12-16 18:48:17 (GMT)
commit83a6923af0156de7575fac4bfb0ad2ee5023b361 (patch)
tree8f1e6be9715dcb0729fb38967e79de6014518bd4 /gdhcp
parent82e0927004c06a108ad31b72a41e674a2462fede (diff)
downloadconnman-83a6923af0156de7575fac4bfb0ad2ee5023b361.zip
connman-83a6923af0156de7575fac4bfb0ad2ee5023b361.tar.gz
connman-83a6923af0156de7575fac4bfb0ad2ee5023b361.tar.bz2
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
Diffstat (limited to 'gdhcp')
-rw-r--r--gdhcp/client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdhcp/client.c b/gdhcp/client.c
index 3270346..6df3281 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;