X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/blobdiff_plain/410c8acf139e945dce28bbc0c8b17dcfd0815643..d6623498a744000582f21ca046f1c79766e0bafc:/tripe.c diff --git a/tripe.c b/tripe.c index 6ff4a6a8..0d44382f 100644 --- a/tripe.c +++ b/tripe.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: tripe.c,v 1.1 2001/02/03 20:26:37 mdw Exp $ + * $Id: tripe.c,v 1.5 2001/02/16 21:43:12 mdw Exp $ * * Main program * @@ -29,6 +29,18 @@ /*----- Revision history --------------------------------------------------* * * $Log: tripe.c,v $ + * Revision 1.5 2001/02/16 21:43:12 mdw + * Provide a more helpful usage message. + * + * Revision 1.4 2001/02/16 21:41:31 mdw + * Add a new buffer. + * + * Revision 1.3 2001/02/04 17:10:40 mdw + * Remove a debugging @abort@ call. + * + * Revision 1.2 2001/02/03 22:33:00 mdw + * Stuff more randomness into the pool in the interval timer. + * * Revision 1.1 2001/02/03 20:26:37 mdw * Initial checkin. * @@ -41,7 +53,7 @@ /*----- Global variables --------------------------------------------------*/ sel_state sel; -octet buf_i[PKBUFSZ], buf_o[PKBUFSZ]; +octet buf_i[PKBUFSZ], buf_o[PKBUFSZ], buf_t[PKBUFSZ]; /*----- Static variables --------------------------------------------------*/ @@ -64,6 +76,7 @@ void interval(struct timeval *tv, void *v) { struct timeval tvv; T( trace(T_PEER, "peer: interval timer"); ) + rand_seed(RAND_GLOBAL, HASHSZ); p_interval(); tvv = *tv; tvv.tv_sec += T_INTERVAL; @@ -82,7 +95,8 @@ void interval(struct timeval *tv, void *v) static void usage(FILE *fp) { - pquis(fp, "Usage: $ [-options]\n"); + pquis(fp, "Usage: $ [-D] [-p port] [-T trace-opts] [-d dir] [-a socket]\n\ + [-k priv-keyring] [-K pub-keyring] [-t key-tag]\n"); } static void version(FILE *fp) @@ -275,7 +289,7 @@ int main(int argc, char *argv[]) km_init(kr_priv, kr_pub, tag_priv); a_init(csock); if (f & f_daemon) { - if (u_daemon) + if (u_daemon()) die(EXIT_FAILURE, "couldn't become a daemon: %s", strerror(errno)); a_daemon(); } @@ -294,7 +308,6 @@ int main(int argc, char *argv[]) selerr = 0; else if (errno != EINTR && errno != EAGAIN) { a_warn("select failed: %s", strerror(errno)); - abort(); selerr++; if (selerr > 8) { a_warn("too many select errors: bailing out");