Thread (5 messages) 5 messages, 3 authors, 2014-02-03

[PATCH 2/3] android/pan: Handle error case properly in NAP registration

flat view
STALE4628d

From: Ravi kumar Veeramally <hidden>
Date: 2014-01-23 13:39:26
Subsystem: the rest · Maintainer: Linus Torvalds

---
 android/pan.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/android/pan.c b/android/pan.c
index 67c7556..67b62f2 100644
--- a/android/pan.c
+++ b/android/pan.c
@@ -471,8 +471,10 @@ static int set_forward_delay(void)
 	int fd, ret;
 
 	fd = open(FORWARD_DELAY_PATH, O_RDWR);
-	if (fd < 0)
+	if (fd < 0) {
+		error("open forward delay path : %s", strerror(errno));
 		return -errno;
+	}
 
 	ret = write(fd, "0", sizeof("0"));
 	close(fd);
@@ -728,7 +730,7 @@ bool bt_pan_register(const bdaddr_t *addr)
 	}
 
 	err = bnep_init();
-	if (err) {
+	if (err < 0) {
 		error("bnep init failed");
 		bt_adapter_remove_record(rec->handle);
 		return false;
@@ -736,6 +738,7 @@ bool bt_pan_register(const bdaddr_t *addr)
 
 	err = register_nap_server();
 	if (err < 0) {
+		error("Failed to register NAP");
 		bt_adapter_remove_record(rec->handle);
 		bnep_cleanup();
 		return false;
-- 
1.8.3.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help