[or-cvs] Fix DOS line endings; autoconfize checks for strptime and ...

Nick Mathewson nickm at seul.org
Tue Mar 9 22:09:15 UTC 2004


Update of /home/or/cvsroot/src/common
In directory moria.mit.edu:/tmp/cvs-serv15735/src/common

Modified Files:
	log.c util.c util.h 
Log Message:
Fix DOS line endings; autoconfize checks for strptime and  inet_aton

Index: log.c
===================================================================
RCS file: /home/or/cvsroot/src/common/log.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- log.c	9 Mar 2004 22:01:16 -0000	1.31
+++ log.c	9 Mar 2004 22:09:12 -0000	1.32
@@ -2,9 +2,9 @@
 /* See LICENSE for licensing information */
 /* $Id$ */
 
-#include "../or/or.h"
-#ifdef MS_WINDOWS
-#define vsnprintf _vsnprintf
+#include "../or/or.h"
+#ifdef MS_WINDOWS
+#define vsnprintf _vsnprintf
 #endif
 
 struct logfile_t;

Index: util.c
===================================================================
RCS file: /home/or/cvsroot/src/common/util.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- util.c	9 Mar 2004 22:01:16 -0000	1.56
+++ util.c	9 Mar 2004 22:09:12 -0000	1.57
@@ -506,7 +506,7 @@
 /* Check whether dirname exists and is private.  If yes returns
    0.  Else returns -1. */
 int check_private_dir(const char *dirname, int create)
-{
+{
   int r;
   struct stat st;
   if (stat(dirname, &st)) {
@@ -519,11 +519,11 @@
       log(LOG_WARN, "Directory %s does not exist.", dirname);
       return -1;
     }
-    log(LOG_INFO, "Creating directory %s", dirname);
-#ifdef MS_WINDOWS
-	r = mkdir(dirname);
-#else
-	r = mkdir(dirname, 0700);
+    log(LOG_INFO, "Creating directory %s", dirname);
+#ifdef MS_WINDOWS
+	r = mkdir(dirname);
+#else
+	r = mkdir(dirname, 0700);
 #endif
     if (r) {
       log(LOG_WARN, "Error creating directory %s: %s", dirname,
@@ -536,7 +536,7 @@
   if (!(st.st_mode & S_IFDIR)) {
     log(LOG_WARN, "%s is not a directory", dirname);
     return -1;
-  }
+  }
 #ifndef MS_WINDOWS
   if (st.st_uid != getuid()) {
     log(LOG_WARN, "%s is not owned by this UID (%d)", dirname, (int)getuid());
@@ -551,7 +551,7 @@
     } else {
       return 0;
     }
-  }
+  }
 #endif
   return 0;
 }
@@ -863,22 +863,21 @@
   return -1;
 }
 
-int tor_inet_aton(const char *c, struct in_addr* addr)
-{
-#ifndef MS_WINDOWS
-  /* XXXX WWWW Should be HAVE_INET_ATON */
-  return inet_aton(c, addr);
-#else
-  uint32_t r;
-  assert(c && addr);
-  if (strcmp(c, "255.255.255.255") == 0) {
-	addr->s_addr = 0xFFFFFFFFu;
-	return 1;
-  }
-  r = inet_addr(c);
-  if (r == INADDR_NONE)
-	return 0;
-  addr->s_addr = r;
-  return 1;
-#endif
-}
\ No newline at end of file
+int tor_inet_aton(const char *c, struct in_addr* addr)
+{
+#ifdef HAVE_INET_ATON
+  return inet_aton(c, addr);
+#else
+  uint32_t r;
+  assert(c && addr);
+  if (strcmp(c, "255.255.255.255") == 0) {
+	addr->s_addr = 0xFFFFFFFFu;
+	return 1;
+  }
+  r = inet_addr(c);
+  if (r == INADDR_NONE)
+	return 0;
+  addr->s_addr = r;
+  return 1;
+#endif
+}

Index: util.h
===================================================================
RCS file: /home/or/cvsroot/src/common/util.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- util.h	9 Mar 2004 22:01:16 -0000	1.32
+++ util.h	9 Mar 2004 22:09:12 -0000	1.33
@@ -101,9 +101,9 @@
 
 void write_pidfile(char *filename);
 int switch_id(char *user, char *group);
-
-struct in_addr;
-int tor_inet_aton(const char *cp, struct in_addr *addr);
+
+struct in_addr;
+int tor_inet_aton(const char *cp, struct in_addr *addr);
 
 /* For stupid historical reasons, windows sockets have an independent set of
  * errnos which they use as the fancy strikes them.



More information about the tor-commits mailing list