From: Guus Sliepen Date: Sun, 15 Sep 2002 14:55:54 +0000 (+0000) Subject: Small fixes so tinc compiles out of the box on SunOS 5.8 X-Git-Tag: release-1.0pre8~4 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=5eca9520d93bced1275d45e5e2a933d69354cd6d;p=tinc Small fixes so tinc compiles out of the box on SunOS 5.8 --- diff --git a/configure.in b/configure.in index 249cd14e..77db35a4 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -dnl $Id: configure.in,v 1.13.2.58 2002/09/09 19:39:53 guus Exp $ +dnl $Id: configure.in,v 1.13.2.59 2002/09/15 14:55:53 guus Exp $ AC_PREREQ(2.53) AC_INIT(src/tincd.c) @@ -86,8 +86,13 @@ dnl Checks for libraries. dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stdint.h strings.h syslog.h unistd.h \ -net/ethernet.h net/if.h netinet/in_systm.h netinet/ip.h netinet/tcp.h \ -sys/file.h sys/ioctl.h sys/param.h sys/time.h]) + sys/file.h sys/ioctl.h sys/param.h sys/time.h netinet/in_systm.h]) +AC_CHECK_HEADERS([net/ethernet.h net/if.h netinet/ip.h netinet/tcp.h], [], [], + [#include + #include + #ifdef HAVE_NETINET_IN_SYSTM_H + #include + #endif]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -128,8 +133,7 @@ AC_FUNC_MEMCMP AC_FUNC_ALLOCA AC_TYPE_SIGNAL AC_CHECK_FUNCS([asprintf daemon fcloseall flock ftime get_current_dir_name \ -putenv select strdup strerror strsignal strtol unsetenv \ -freeaddrinfo gai_strerror getaddrinfo getnameinfo mlockall]) +putenv select strdup strerror strsignal strtol unsetenv mlockall]) jm_FUNC_MALLOC jm_FUNC_REALLOC @@ -142,6 +146,8 @@ AC_CHECK_FUNC(gethostbyname, [], [ AC_CHECK_LIB(nsl, gethostbyname) ]) +AC_CHECK_FUNCS([freeaddrinfo gai_strerror getaddrinfo getnameinfo]) + AC_CACHE_SAVE dnl These are defined in files in m4/ diff --git a/lib/fake-getnameinfo.c b/lib/fake-getnameinfo.c index 894c6952..05416487 100644 --- a/lib/fake-getnameinfo.c +++ b/lib/fake-getnameinfo.c @@ -11,9 +11,11 @@ #include "config.h" +#include #include -#include #include +#include +#include #include #include diff --git a/src/net.c b/src/net.c index c56fe98d..f81c4ba8 100644 --- a/src/net.c +++ b/src/net.c @@ -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: net.c,v 1.35.4.181 2002/09/09 22:32:39 guus Exp $ + $Id: net.c,v 1.35.4.182 2002/09/15 14:55:53 guus Exp $ */ #include "config.h" @@ -25,16 +25,6 @@ #include #include #include -#include -#ifdef HAVE_NETINET_IN_SYSTM_H -#include -#endif -#ifdef HAVE_NETINET_IP_H -#include -#endif -#ifdef HAVE_NETINET_TCP_H -#include -#endif #include #include #include @@ -49,6 +39,16 @@ #include #include #include +#ifdef HAVE_NETINET_IN_SYSTM_H +#include +#endif +#include +#ifdef HAVE_NETINET_IP_H +#include +#endif +#ifdef HAVE_NETINET_TCP_H +#include +#endif #include diff --git a/src/net_packet.c b/src/net_packet.c index eaa2cf18..7c51ad63 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -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: net_packet.c,v 1.1.2.23 2002/09/09 22:32:44 guus Exp $ + $Id: net_packet.c,v 1.1.2.24 2002/09/15 14:55:53 guus Exp $ */ #include "config.h" @@ -26,15 +26,6 @@ #include #include #include -#ifdef HAVE_NETINET_IN_SYSTM_H -#include -#endif -#ifdef HAVE_NETINET_IP_H -#include -#endif -#ifdef HAVE_NETINET_TCP_H -#include -#endif #include #include #include @@ -49,6 +40,15 @@ #include #include #include +#ifdef HAVE_NETINET_IN_SYSTM_H +#include +#endif +#ifdef HAVE_NETINET_IP_H +#include +#endif +#ifdef HAVE_NETINET_TCP_H +#include +#endif #include #include diff --git a/src/net_setup.c b/src/net_setup.c index 5243b1e9..ec47f60d 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -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: net_setup.c,v 1.1.2.26 2002/09/09 22:32:44 guus Exp $ + $Id: net_setup.c,v 1.1.2.27 2002/09/15 14:55:53 guus Exp $ */ #include "config.h" @@ -26,15 +26,6 @@ #include #include #include -#ifdef HAVE_NETINET_IN_SYSTM_H -#include -#endif -#ifdef HAVE_NETINET_IP_H -#include -#endif -#ifdef HAVE_NETINET_TCP_H -#include -#endif #include #include #include @@ -49,6 +40,15 @@ #include #include #include +#ifdef HAVE_NETINET_IN_SYSTM_H +#include +#endif +#ifdef HAVE_NETINET_IP_H +#include +#endif +#ifdef HAVE_NETINET_TCP_H +#include +#endif #include #include diff --git a/src/net_socket.c b/src/net_socket.c index eedef7b2..05485f8d 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -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: net_socket.c,v 1.1.2.21 2002/09/09 22:32:44 guus Exp $ + $Id: net_socket.c,v 1.1.2.22 2002/09/15 14:55:53 guus Exp $ */ #include "config.h" @@ -26,15 +26,6 @@ #include #include #include -#ifdef HAVE_NETINET_IN_SYSTM_H -#include -#endif -#ifdef HAVE_NETINET_IP_H -#include -#endif -#ifdef HAVE_NETINET_TCP_H -#include -#endif #include #include #include @@ -49,6 +40,15 @@ #include #include #include +#ifdef HAVE_NETINET_IN_SYSTM_H +#include +#endif +#ifdef HAVE_NETINET_IP_H +#include +#endif +#ifdef HAVE_NETINET_TCP_H +#include +#endif #include #include diff --git a/src/process.c b/src/process.c index a70d8d28..edcd5a00 100644 --- a/src/process.c +++ b/src/process.c @@ -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: process.c,v 1.1.2.48 2002/09/10 09:40:25 guus Exp $ + $Id: process.c,v 1.1.2.49 2002/09/15 14:55:53 guus Exp $ */ #include "config.h" @@ -370,9 +370,7 @@ RETSIGTYPE sigint_handler(int a) debug_lvl = saved_debug_lvl; saved_debug_lvl = 0; } else { - syslog(LOG_NOTICE, - _ - ("Temporarily setting debug level to 5. Kill me with SIGINT again to go back to level %d."), + syslog(LOG_NOTICE, _("Temporarily setting debug level to 5. Kill me with SIGINT again to go back to level %d."), debug_lvl); saved_debug_lvl = debug_lvl; debug_lvl = 5; @@ -469,9 +467,7 @@ void setup_signals(void) for(i = 0; sighandlers[i].signal; i++) { act.sa_handler = sighandlers[i].handler; if(sigaction(sighandlers[i].signal, &act, NULL) < 0) - fprintf(stderr, - _ - ("Installing signal handler for signal %d (%s) failed: %s\n"), + fprintf(stderr, _("Installing signal handler for signal %d (%s) failed: %s\n"), sighandlers[i].signal, strsignal(sighandlers[i].signal), strerror(errno)); } diff --git a/src/protocol_edge.c b/src/protocol_edge.c index 6129f71b..0ac9e7c8 100644 --- a/src/protocol_edge.c +++ b/src/protocol_edge.c @@ -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: protocol_edge.c,v 1.1.4.13 2002/09/09 22:33:02 guus Exp $ + $Id: protocol_edge.c,v 1.1.4.14 2002/09/15 14:55:53 guus Exp $ */ #include "config.h" @@ -220,9 +220,7 @@ int del_edge_h(connection_t *c) if(!from) { if(debug_lvl >= DEBUG_PROTOCOL) - syslog(LOG_ERR, - _ - ("Got %s from %s (%s) which does not appear in the edge tree"), + syslog(LOG_ERR, _("Got %s from %s (%s) which does not appear in the edge tree"), "DEL_EDGE", c->name, c->hostname); return 0; } @@ -231,9 +229,7 @@ int del_edge_h(connection_t *c) if(!to) { if(debug_lvl >= DEBUG_PROTOCOL) - syslog(LOG_ERR, - _ - ("Got %s from %s (%s) which does not appear in the edge tree"), + syslog(LOG_ERR, _("Got %s from %s (%s) which does not appear in the edge tree"), "DEL_EDGE", c->name, c->hostname); return 0; } @@ -244,9 +240,7 @@ int del_edge_h(connection_t *c) if(!e) { if(debug_lvl >= DEBUG_PROTOCOL) - syslog(LOG_WARNING, - _ - ("Got %s from %s (%s) which does not appear in the edge tree"), + syslog(LOG_WARNING, _("Got %s from %s (%s) which does not appear in the edge tree"), "DEL_EDGE", c->name, c->hostname); return 0; } diff --git a/src/subnet.c b/src/subnet.c index fa00cd88..4e528e1a 100644 --- a/src/subnet.c +++ b/src/subnet.c @@ -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: subnet.c,v 1.1.2.42 2002/09/09 22:33:21 guus Exp $ + $Id: subnet.c,v 1.1.2.43 2002/09/15 14:55:54 guus Exp $ */ #include "config.h" @@ -111,9 +111,7 @@ int subnet_compare(subnet_t *a, subnet_t *b) case SUBNET_IPV6: return subnet_compare_ipv6(a, b); default: - syslog(LOG_ERR, - _ - ("subnet_compare() was called with unknown subnet type %d, exitting!"), + syslog(LOG_ERR, _("subnet_compare() was called with unknown subnet type %d, exitting!"), a->type); cp_trace(); exit(0); diff --git a/src/tincd.c b/src/tincd.c index 8ebbe42a..2aa16dd4 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -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.64 2002/09/15 12:26:04 guus Exp $ + $Id: tincd.c,v 1.10.4.65 2002/09/15 14:55:54 guus Exp $ */ #include "config.h" @@ -110,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" @@ -178,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); } @@ -199,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); }