Various fixes for autoconf and OpenSSL 0.9.7 and a missing header.
[tinc] / src / tincd.c
index 6bd92ec..4335d7b 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: tincd.c,v 1.10.4.63 2002/09/09 21:25:16 guus Exp $
+    $Id: tincd.c,v 1.10.4.66 2003/01/17 00:43:58 guus Exp $
 */
 
 #include "config.h"
 #include <signal.h>
 #include <string.h>
 #include <termios.h>
+
+/* Darwin (MacOS/X) needs the following definition... */
+#ifndef _P1003_1B_VISIBLE
+#define _P1003_1B_VISIBLE
+#endif
+
 #include <sys/mman.h>
 
 #ifdef HAVE_SYS_IOCTL_H
@@ -104,8 +110,7 @@ static void usage(int status)
                                program_name);
        else {
                printf(_("Usage: %s [option]...\n\n"), program_name);
-               printf(_
-                          ("  -c, --config=DIR           Read configuration options from DIR.\n"
+               printf(_("  -c, --config=DIR           Read configuration options from DIR.\n"
                                "  -D, --no-detach            Don't fork and detach.\n"
                                "  -d, --debug[=LEVEL]        Increase debug level or set it to LEVEL.\n"
                                "  -k, --kill[=SIGNAL]        Attempt to kill a running tincd and exit.\n"
@@ -172,9 +177,7 @@ void parse_options(int argc, char **argv, char **envp)
                                                kill_tincd = atoi(optarg);
 
                                                if(!kill_tincd) {
-                                                       fprintf(stderr,
-                                                                       _
-                                                                       ("Invalid argument `%s'; SIGNAL must be a number or one of HUP, TERM, KILL, USR1, USR2, WINCH, INT or ALRM.\n"),
+                                                       fprintf(stderr, _("Invalid argument `%s'; SIGNAL must be a number or one of HUP, TERM, KILL, USR1, USR2, WINCH, INT or ALRM.\n"),
                                                                        optarg);
                                                        usage(1);
                                                }
@@ -193,9 +196,7 @@ void parse_options(int argc, char **argv, char **envp)
                                        generate_keys = atoi(optarg);
 
                                        if(generate_keys < 512) {
-                                               fprintf(stderr,
-                                                               _
-                                                               ("Invalid argument `%s'; BITS must be a number equal to or greater than 512.\n"),
+                                               fprintf(stderr, _("Invalid argument `%s'; BITS must be a number equal to or greater than 512.\n"),
                                                                optarg);
                                                usage(1);
                                        }
@@ -389,10 +390,18 @@ int main(int argc, char **argv, char **envp)
 
        RAND_load_file("/dev/urandom", 1024);
 
+#ifdef HAVE_OPENSSL_ADD_ALL_ALGORITHMS_NOCONF
+       OPENSSL_add_all_algorithms_noconf();
+#else
+#ifdef HAVE_OPENSSL_ADD_ALL_ALGORITHMS
+       OpenSSL_add_all_algorithms();
+#else
 #ifdef HAVE_SSLEAY_ADD_ALL_ALGORITHMS
        SSLeay_add_all_algorithms();
 #else
-       OpenSSL_add_all_algorithms();
+#error No add_all_algorithms function available!
+#endif
+#endif
 #endif
 
        if(generate_keys) {