2003-06-19 Paul Jakma <paul@dishone.st>
* Fix lib/smux.c's reliance on daemons exporting struct
thread_master *master.
diff --git a/lib/smux.c b/lib/smux.c
index 952c5a8..c6884d1 100644
--- a/lib/smux.c
+++ b/lib/smux.c
@@ -29,7 +29,6 @@
#include <snmp.h>
#include <snmp_impl.h>
-#include "smux.h"
#include "log.h"
#include "thread.h"
#include "linklist.h"
@@ -37,6 +36,7 @@
#include "version.h"
#include "memory.h"
#include "sockunion.h"
+#include "smux.h"
#define min(A,B) ((A) < (B) ? (A) : (B))
@@ -81,6 +81,9 @@
SMUX_NODE,
"" /* SMUX has no interface. */
};
+
+/* thread master */
+static struct thread_master *master;
void *
oid_copy (void *dest, void *src, size_t size)
@@ -1224,7 +1227,7 @@
}
}
-extern struct thread_master *master;
+
void
smux_event (enum smux_event event, int sock)
@@ -1471,7 +1474,7 @@
/* Initialize some values then schedule first SMUX connection. */
void
-smux_init (oid defoid[], size_t defoid_len)
+smux_init (struct thread_master *tm, oid defoid[], size_t defoid_len)
{
/* Set default SMUX oid. */
smux_default_oid = defoid;
@@ -1480,6 +1483,9 @@
smux_oid = smux_default_oid;
smux_oid_len = smux_default_oid_len;
smux_passwd = smux_default_passwd;
+
+ /* copy callers thread master */
+ master = tm;
/* Make MIB tree. */
treelist = list_new();