Do not close socket twice 47/204447/2
authorCheoleun Moon <chleun.moon@samsung.com>
Wed, 24 Apr 2019 04:50:56 +0000 (13:50 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Wed, 24 Apr 2019 04:58:07 +0000 (13:58 +0900)
g_io_channel_shutdown closes the fd of the channel.

Change-Id: Iebb2f2eb3421094fc573ba859a65c2b18e86fbcc
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
src/ip-conflict-detect.c

index 743c292..4c2a3f3 100755 (executable)
@@ -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");