handover: Move handover_close function up
authorOlivier Guiter <olivier.guiter@linux.intel.com>
Thu, 28 Jun 2012 13:43:45 +0000 (15:43 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 28 Jun 2012 15:02:58 +0000 (17:02 +0200)
plugins/handover.c

index fee53fe..0db2b5d 100644 (file)
@@ -92,6 +92,19 @@ static void free_hr_ndef(gpointer data)
        g_free(ndef);
 }
 
+static void handover_close(int client_fd, int err)
+{
+       struct hr_ndef *ndef;
+
+       DBG("");
+
+       ndef = g_hash_table_lookup(hr_ndef_hash, GINT_TO_POINTER(client_fd));
+       if (ndef == NULL)
+               return;
+
+       g_hash_table_remove(hr_ndef_hash, GINT_TO_POINTER(client_fd));
+}
+
 /* Parse an incoming handover buffer*/
 static int handover_ndef_parse(int client_fd, struct hr_ndef *ndef)
 {
@@ -132,19 +145,6 @@ fail:
        return err;
 }
 
-static void handover_close(int client_fd, int err)
-{
-       struct hr_ndef *ndef;
-
-       DBG("");
-
-       ndef = g_hash_table_lookup(hr_ndef_hash, GINT_TO_POINTER(client_fd));
-       if (ndef == NULL)
-               return;
-
-       g_hash_table_remove(hr_ndef_hash, GINT_TO_POINTER(client_fd));
-}
-
 static near_bool_t handover_recv_error(void)
 {
        near_error("%s", strerror(errno));