summaryrefslogtreecommitdiffstats
path: root/hcid/security.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-12-27 09:29:47 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-12-27 09:29:47 +0000
commitc96dc5deee19c9db3f15a352a5ec956e22f04d39 (patch)
treec38bfaf1d2d654e3a30f6faa0cade15bfa5cedaf /hcid/security.c
parentf94e51848512064902c508cd8473dd6e1f1a0e5a (diff)
Another bunch of whitespace cleanups
Diffstat (limited to 'hcid/security.c')
-rw-r--r--hcid/security.c8
1 files changed, 6 insertions, 2 deletions
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;
}