summaryrefslogtreecommitdiffstats
path: root/network
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-08-24 21:14:41 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-08-24 21:14:41 +0000
commitb439d4cb2cd66a2ffee1a7aa86c677a056c61a69 (patch)
tree432017363a69755bc5756a6a6bc06c71f13c4692 /network
parent1e324b3b2e7963eea7509998aaa4fb3fa470979b (diff)
network: fixed wrong pointer reference
Diffstat (limited to 'network')
-rw-r--r--network/server.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/network/server.c b/network/server.c
index 3d17fcd0..d1ebe3ee 100644
--- a/network/server.c
+++ b/network/server.c
@@ -59,7 +59,7 @@
#include "manager.h"
#include "server.h"
-static GIOChannel *bnep_io;
+static GIOChannel *bnep_io = NULL;
/* Pending Authorization */
struct pending_auth {
@@ -531,7 +531,7 @@ static gboolean connect_event(GIOChannel *chan,
return TRUE;
}
-int server_init(DBusConnection *conn, gboolean secure)
+int server_init(struct network_server *ns)
{
struct l2cap_options l2o;
struct sockaddr_l2 l2a;
@@ -577,7 +577,7 @@ int server_init(DBusConnection *conn, gboolean secure)
}
/* Set link mode */
- lm = (secure ? L2CAP_LM_SECURE : 0);
+ lm = (ns->secure ? L2CAP_LM_SECURE : 0);
if (lm && setsockopt(sk, SOL_L2CAP, L2CAP_LM, &lm, sizeof(lm)) < 0) {
err = errno;
error("Failed to set link mode. %s(%d)",
@@ -595,7 +595,7 @@ int server_init(DBusConnection *conn, gboolean secure)
g_io_channel_set_close_on_unref(bnep_io, FALSE);
g_io_add_watch(bnep_io, G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
- connect_event, conn);
+ connect_event, ns);
return 0;
fail:
@@ -761,7 +761,7 @@ static int record_and_listen(struct network_server *ns)
return -EIO;
}
- if (bnep_io == NULL && (err = server_init(ns->conn, ns->secure)) < 0)
+ if (bnep_io == NULL && (err = server_init(ns)) < 0)
return -err;
return 0;