[or-cvs] Port to MacOS X
Nick Mathewson
nickm at seul.org
Tue Sep 3 18:44:26 UTC 2002
Update of /home/or/cvsroot/src/or
In directory moria.seul.org:/tmp/cvs-serv32503/src/or
Modified Files:
config.c main.c onion.c or.h
Log Message:
Port to MacOS X
Index: config.c
===================================================================
RCS file: /home/or/cvsroot/src/or/config.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- config.c 3 Sep 2002 18:36:40 -0000 1.13
+++ config.c 3 Sep 2002 18:44:23 -0000 1.14
@@ -10,7 +10,19 @@
*/
#include "or.h"
-#include <libgen.h>
+#include <string.h>
+
+const char *
+basename(const char *filename)
+{
+ char *result;
+ /* XXX This won't work on windows. */
+ result = strrchr(filename, '/');
+ if (result)
+ return result;
+ else
+ return filename;
+}
/* loads the configuration file */
int getconfig(char *conf_filename, config_opt_t *options)
Index: main.c
===================================================================
RCS file: /home/or/cvsroot/src/or/main.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- main.c 3 Sep 2002 18:36:40 -0000 1.19
+++ main.c 3 Sep 2002 18:44:23 -0000 1.20
@@ -12,8 +12,9 @@
static connection_t *connection_array[MAXCONNECTIONS] =
{ NULL };
-static struct pollfd poll_array[MAXCONNECTIONS] =
- { [0 ... MAXCONNECTIONS-1] = { -1, 0, 0 } };
+static struct pollfd poll_array[MAXCONNECTIONS];
+/* = { [0 ... MAXCONNECTIONS-1] = { -1, 0, 0 } };
+ */
static int nfds=0; /* number of connections currently active */
Index: onion.c
===================================================================
RCS file: /home/or/cvsroot/src/or/onion.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- onion.c 24 Aug 2002 07:55:49 -0000 1.11
+++ onion.c 3 Sep 2002 18:44:24 -0000 1.12
@@ -124,6 +124,7 @@
num_acceptable_routers++;
log(LOG_DEBUG,"I like %d. num_acceptable_routers now %d.",i, num_acceptable_routers);
next_i_loop:
+ ;
}
if(num_acceptable_routers < *routelen) {
Index: or.h
===================================================================
RCS file: /home/or/cvsroot/src/or/or.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- or.h 24 Aug 2002 08:24:30 -0000 1.16
+++ or.h 3 Sep 2002 18:44:24 -0000 1.17
@@ -5,14 +5,24 @@
#ifndef __OR_H
#define __OR_H
+#include "orconfig.h"
+#undef VERSION
+
#include <stdio.h>
#include <stdlib.h>
+#include <stdint.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <netdb.h>
#include <ctype.h>
+#ifdef HAVE_SYS_POLL_H
#include <sys/poll.h>
+#elif HAVE_POLL_H
+#include <poll.h>
+#else
+#include "../common/fakepoll.h"
+#endif
#include <sys/types.h>
#include <sys/fcntl.h>
#include <sys/ioctl.h>
More information about the tor-commits
mailing list