summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2006-11-09 21:40:06 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2006-11-09 21:40:06 +0000
commitca0904086725bcf98343f8b2b56b148635b15812 (patch)
tree995b4ecd23ab25329e8f70953484ea938044c71f
parente03c53fe8dd171ffad0051c20501aa82d836379e (diff)
Prevent errno overwriting when unregistering agent service records
-rw-r--r--hcid/dbus-service.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hcid/dbus-service.c b/hcid/dbus-service.c
index 71ba4afd..ed6e3fcf 100644
--- a/hcid/dbus-service.c
+++ b/hcid/dbus-service.c
@@ -247,6 +247,7 @@ static int unregister_agent_records(struct slist *lrecords)
{
sdp_session_t *sess;
struct binary_record *rec;
+ int err;
/* FIXME: attach to a specific adapter */
sess = sdp_connect(BDADDR_ANY, BDADDR_LOCAL, 0);
@@ -267,7 +268,11 @@ static int unregister_agent_records(struct slist *lrecords)
strerror(errno), errno);
}
}
+
+ err = errno;
sdp_close(sess);
+ errno = err;
+
return 0;
}