From 6aea4e00f2b9a1c70210ef480b5246829f15deaf Mon Sep 17 00:00:00 2001 From: Cheoleun Moon Date: Wed, 24 Apr 2019 13:50:56 +0900 Subject: [PATCH] Do not close socket twice g_io_channel_shutdown closes the fd of the channel. Change-Id: Iebb2f2eb3421094fc573ba859a65c2b18e86fbcc Signed-off-by: Cheoleun Moon --- src/ip-conflict-detect.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/ip-conflict-detect.c b/src/ip-conflict-detect.c index 743c292..4c2a3f3 100755 --- a/src/ip-conflict-detect.c +++ b/src/ip-conflict-detect.c @@ -215,18 +215,9 @@ out: static void __close_channel_and_sock(struct sock_data *sd) { - GError *error = NULL; - if (sd == NULL) return; - if (G_IO_STATUS_NORMAL != - g_io_channel_shutdown(sd->chk_conflict_sock_io, FALSE, - &error)) { - INFO("Failure received while shutdown io channel[%d]:[%s]", error->code, error->message); - g_error_free(error); - } - g_io_channel_unref(sd->chk_conflict_sock_io); g_source_remove(sd->chk_conflict_data_id); sd->chk_conflict_data_id = -1; @@ -253,7 +244,6 @@ static int __open_channel_and_sock(struct sock_data *sd) return -1; } - g_io_channel_set_close_on_unref(sd->chk_conflict_sock_io, TRUE); if (G_IO_STATUS_NORMAL != g_io_channel_set_encoding(sd->chk_conflict_sock_io, NULL, NULL)) INFO("Failed to set encoding NULL on io channel"); -- 2.34.1