From c96dc5deee19c9db3f15a352a5ec956e22f04d39 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 27 Dec 2005 09:29:47 +0000 Subject: Another bunch of whitespace cleanups --- hcid/security.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'hcid/security.c') diff --git a/hcid/security.c b/hcid/security.c index eaaa7936..60204c45 100644 --- a/hcid/security.c +++ b/hcid/security.c @@ -117,6 +117,7 @@ static struct link_key *__get_link_key(int f, bdaddr_t *sba, bdaddr_t *dba) break; } } + return key; } @@ -131,7 +132,9 @@ static struct link_key *get_link_key(bdaddr_t *sba, bdaddr_t *dba) else if (errno != ENOENT) syslog(LOG_ERR, "Link key database open failed: %s (%d)", strerror(errno), errno); + close(f); + return key; } @@ -197,7 +200,7 @@ static void save_link_key(struct link_key *key) strerror(errno), errno); goto failed; } - + if (write_n(f, key, sizeof(*key)) < 0) { syslog(LOG_ERR, "Link key database write failed: %s (%d)", strerror(errno), errno); @@ -280,7 +283,9 @@ static int read_default_pin_code(void) hcid.pin_file, strerror(errno), errno); len = -1; } + fclose(f); + return len; } @@ -871,5 +876,4 @@ void init_security_data(void) } pairing = hcid.pairing; - return; } -- cgit