summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-03-09 22:09:13 +0000
committerNick Mathewson <nickm@torproject.org>2004-03-09 22:09:13 +0000
commit0e5a13470917fc1b9f2ed3ae7e632a265857a774 (patch)
tree6dff681f4d41c4a11b801df9f56ef3b913e43797
parent2da54de9682716729154872ffc7946fbca1d6391 (diff)
downloadtor-0e5a13470917fc1b9f2ed3ae7e632a265857a774.tar.gz
tor-0e5a13470917fc1b9f2ed3ae7e632a265857a774.zip
Fix DOS line endings; autoconfize checks for strptime and inet_aton
svn:r1248
-rw-r--r--configure.in2
-rw-r--r--src/common/util.c5
-rw-r--r--src/or/connection.c2
-rw-r--r--src/or/routerlist.c5
-rw-r--r--src/win32/orconfig.h6
5 files changed, 11 insertions, 9 deletions
diff --git a/configure.in b/configure.in
index 95407676ef..8f318b8f04 100644
--- a/configure.in
+++ b/configure.in
@@ -136,7 +136,7 @@ dnl These headers are not essential
AC_CHECK_HEADERS(stdint.h sys/types.h inttypes.h sys/wait.h netinet/in.h arpa/inet.h)
-AC_CHECK_FUNCS(gettimeofday ftime socketpair uname)
+AC_CHECK_FUNCS(gettimeofday ftime socketpair uname inet_aton strptime)
dnl In case we aren't given a working stdint.h, we'll need to grow our own.
dnl Watch out.
diff --git a/src/common/util.c b/src/common/util.c
index 3c62956132..a62b0d320b 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -865,8 +865,7 @@ int switch_id(char *user, char *group) {
int tor_inet_aton(const char *c, struct in_addr* addr)
{
-#ifndef MS_WINDOWS
- /* XXXX WWWW Should be HAVE_INET_ATON */
+#ifdef HAVE_INET_ATON
return inet_aton(c, addr);
#else
uint32_t r;
@@ -881,4 +880,4 @@ int tor_inet_aton(const char *c, struct in_addr* addr)
addr->s_addr = r;
return 1;
#endif
-} \ No newline at end of file
+}
diff --git a/src/or/connection.c b/src/or/connection.c
index 1c7e3cf219..f2528aa00b 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -434,7 +434,7 @@ int retry_all_connections(void) {
if(options.SocksPort) {
listener_close_if_present(CONN_TYPE_AP_LISTENER);
- if(connection_create_listener(options.SocksBindAddress,
+ if(connection_create_listener(options.SocksBindAddress,
(uint16_t) options.SocksPort,
CONN_TYPE_AP_LISTENER) < 0)
return -1;
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 4ade31c6f2..64d4e64577 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -544,8 +544,7 @@ int router_exit_policy_rejects_all(routerinfo_t *router) {
static time_t parse_time(const char *cp)
{
struct tm st_tm;
- /* XXXX WWWW should be HAVE_STRPTIME */
-#ifndef MS_WINDOWS
+#ifdef HAVE_STRPTIME
if (!strptime(cp, "%Y-%m-%d %H:%M:%S", &st_tm)) {
log_fn(LOG_WARN, "Published time was unparseable"); return 0;
}
@@ -903,7 +902,7 @@ routerinfo_t *router_get_entry_from_string(const char *s,
log_fn(LOG_WARN, "Missing published time"); goto err;
}
assert(tok->n_args == 1);
- if (!(router->published_on = parse_time(tok->args[0])))
+ if (!(router->published_on = parse_time(tok->args[0])))
goto err;
if (!(tok = find_first_by_keyword(tokens, K_ONION_KEY))) {
diff --git a/src/win32/orconfig.h b/src/win32/orconfig.h
index 29524513ba..c8e089fb3c 100644
--- a/src/win32/orconfig.h
+++ b/src/win32/orconfig.h
@@ -23,6 +23,10 @@
#undef HAVE_GETTIMEOFDAY
+#undef HAVE_STRPTIME
+
+#undef HAVE_INET_ATON
+
/* Define to 1 if the system has the type `int16_t'. */
#undef HAVE_INT16_T
@@ -147,4 +151,4 @@
#define VERSION "0.0.2pre6"
/* XXXX WWWW */
-#define CONFDIR "" \ No newline at end of file
+#define CONFDIR ""