Fix code style 72/203672/4 accepted/tizen/unified/20190425.111815 submit/tizen/20190422.081829
authorCheoleun Moon <chleun.moon@samsung.com>
Wed, 17 Apr 2019 01:02:39 +0000 (10:02 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Mon, 22 Apr 2019 00:19:36 +0000 (09:19 +0900)
Change-Id: I541c2e466d81748420262960e71a1a33436f2821
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
src/ip-conflict-detect.c

index 1873d8b..743c292 100755 (executable)
@@ -213,10 +213,9 @@ out:
        return TRUE;
 }
 
-static void __close_channel_and_sock(struct sock_datasd)
+static void __close_channel_and_sock(struct sock_data *sd)
 {
-       INFO("+");
-       GError* error = NULL;
+       GError *error = NULL;
 
        if (sd == NULL)
                return;
@@ -236,9 +235,8 @@ static void __close_channel_and_sock(struct sock_data* sd)
        sd->chk_conflict_sd = -1;
 }
 
-static int __open_channel_and_sock(struct sock_datasd)
+static int __open_channel_and_sock(struct sock_data *sd)
 {
-       INFO("+");
        if (sd == NULL)
                return -1;
 
@@ -250,16 +248,19 @@ static int __open_channel_and_sock(struct sock_data* sd)
        sd->chk_conflict_sock_io = g_io_channel_unix_new(sd->chk_conflict_sd);
        if (sd->chk_conflict_sock_io == NULL) {
                INFO("Failed to create channel");
-               g_free(sd);
+               close(sd->chk_conflict_sd);
+               sd->chk_conflict_sd = -1;
                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))
+       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");
+
        if (G_IO_STATUS_NORMAL != g_io_channel_set_flags(sd->chk_conflict_sock_io,
                                G_IO_FLAG_NONBLOCK, NULL))
                INFO("Failed to set flags on io channel");
+
        sd->chk_conflict_data_id = g_io_add_watch(sd->chk_conflict_sock_io, G_IO_IN,
                        __netconfig_check_arp_receive, sd);
        DBG("socket %d", sd->chk_conflict_sd);