summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-06-17 01:12:47 +0200
committerMartin Mares <mj@ucw.cz>2000-06-17 01:12:47 +0200
commit4daf03e5138dea8e5c409ab20a07f35667caa89e (patch)
tree1edcb327630e449cf1542ff1089aa1c74a7b6c66
parent365211d5886ec59a543e9fbc2151d6218561c18c (diff)
downloadbird-4daf03e5138dea8e5c409ab20a07f35667caa89e.tar
bird-4daf03e5138dea8e5c409ab20a07f35667caa89e.zip
Use our own SUN_LEN if libc doesn't provide it.
-rw-r--r--TODO4
-rw-r--r--client/client.c11
-rw-r--r--sysdep/unix/unix.h4
3 files changed, 14 insertions, 5 deletions
diff --git a/TODO b/TODO
index 12be399..a409277 100644
--- a/TODO
+++ b/TODO
@@ -1,5 +1,9 @@
Core
~~~~
+- socket open failure should not be fatal
+- &&,||: priorities
+- client: `?' in BGP masks
+- filters: function for BGP path length
Globals
~~~~~~~
diff --git a/client/client.c b/client/client.c
index a139b04..c579352 100644
--- a/client/client.c
+++ b/client/client.c
@@ -22,6 +22,7 @@
#include "lib/resource.h"
#include "lib/string.h"
#include "client/client.h"
+#include "sysdep/unix/unix.h"
static char *opt_list = "s:v";
static int verbose;
@@ -69,7 +70,7 @@ parse_args(int argc, char **argv)
/*** Input ***/
static void server_send(char *);
-static void io_loop(int);
+static void select_loop(int);
/* HACK: libreadline internals we need to access */
extern int _rl_vis_botlin;
@@ -112,7 +113,7 @@ got_line(char *cmd_buffer)
{
server_send(cmd);
input_hidden = -1;
- io_loop(0);
+ select_loop(0);
input_hidden = 0;
}
free(cmd);
@@ -316,7 +317,7 @@ server_read(void)
static fd_set select_fds;
static void
-io_loop(int mode)
+select_loop(int mode)
{
server_reply = -1;
while (mode || server_reply < 0)
@@ -384,10 +385,10 @@ main(int argc, char **argv)
parse_args(argc, argv);
cmd_build_tree();
server_connect();
- io_loop(0);
+ select_loop(0);
input_init();
- io_loop(1);
+ select_loop(1);
return 0;
}
diff --git a/sysdep/unix/unix.h b/sysdep/unix/unix.h
index 5da925c..bb4d063 100644
--- a/sysdep/unix/unix.h
+++ b/sysdep/unix/unix.h
@@ -34,6 +34,10 @@ typedef struct sockaddr_in6 sockaddr;
typedef struct sockaddr_in sockaddr;
#endif
+#ifndef SUN_LEN
+#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) + strlen ((ptr)->sun_path))
+#endif
+
struct birdsock;
void io_init(void);