From 8eb67059c5197e11de20ef6ecbb1b54a9939897d Mon Sep 17 00:00:00 2001 From: Olivier Guiter Date: Thu, 28 Jun 2012 15:43:45 +0200 Subject: [PATCH] handover: Move handover_close function up --- plugins/handover.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/plugins/handover.c b/plugins/handover.c index fee53fe..0db2b5d 100644 --- a/plugins/handover.c +++ b/plugins/handover.c @@ -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)); -- 2.7.4