From: Ted Lemon Date: Wed, 2 Feb 2000 20:01:50 +0000 (+0000) Subject: Minor solaris fixes. X-Git-Tag: V3-BETA-2-PATCH-1~348 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9458e9aa074b9dfc14b014adfff3ef2dc971cdaf;p=thirdparty%2Fdhcp.git Minor solaris fixes. --- diff --git a/Makefile.conf b/Makefile.conf index e41012a1d..f8ba9382b 100644 --- a/Makefile.conf +++ b/Makefile.conf @@ -121,7 +121,8 @@ MINORVERSION=MinorVersion #LIBS = -lresolv -lsocket -lnsl -lgen #CC=gcc #COPTS = $(BINDDEF) -Wall -Wno-unused -Wno-implicit -Wno-comment \ -# -Wno-uninitialized -Wno-char-subscripts -Wno-switch -Werror +# -Wno-uninitialized -Wno-char-subscripts -Wno-switch -Werror \ +# -DSOLARIS_MAJOR=$(MAJORVERSION) -DSOLARIS_MINOR=$(MINORVERSION) #CF = cf/sunos5-5.h #ADMMANDIR = /usr/share/man/cat1m #ADMMANEXT = .1m @@ -140,7 +141,8 @@ MINORVERSION=MinorVersion #MANINSTALL=/usr/ucb/install #LIBS = -lresolv -lsocket -lnsl -lgen #CC=cc -#COPTS = -D__svr4__ $(BINDDEF) +#COPTS = -D__svr4__ $(BINDDEF) \ +# -DSOLARIS_MAJOR=$(MAJORVERSION) -DSOLARIS_MINOR=$(MINORVERSION) #CF = cf/sunos5-5.h #ADMMANDIR = /usr/share/man/cat1m #ADMMANEXT = .1m diff --git a/client/dhclient.c b/client/dhclient.c index 9c18c47db..f5e9018cf 100644 --- a/client/dhclient.c +++ b/client/dhclient.c @@ -29,7 +29,7 @@ #ifndef lint static char ocopyright[] = -"$Id: dhclient.c,v 1.94 2000/01/28 20:30:26 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dhclient.c,v 1.95 2000/02/02 20:01:39 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -165,8 +165,12 @@ int main (argc, argv, envp) /* XXX inelegant hack to prove concept */ char command[1024]; +#if !defined (NO_SNPRINTF) + snprintf (command, "kill `cat %s`", path_dhclient_pid); +#else snprintf (command, 1024, "kill `cat %s`", path_dhclient_pid); +#endif system (command); } diff --git a/common/execute.c b/common/execute.c index 8f3a4e221..9c499477b 100644 --- a/common/execute.c +++ b/common/execute.c @@ -22,7 +22,7 @@ #ifndef lint static char copyright[] = -"$Id: execute.c,v 1.27 2000/02/02 08:01:45 mellon Exp $ Copyright (c) 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; +"$Id: execute.c,v 1.28 2000/02/02 20:01:41 mellon Exp $ Copyright (c) 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -161,7 +161,8 @@ int execute_statements (packet, lease, in_options, out_options, scope, if (status) { if (nut -> r_data) { dfree (nut -> r_data, MDL); - nut -> r_data = (char *)0; + nut -> r_data = + (unsigned char *)0; } if (nut -> r_dname) { dfree (nut -> r_dname, MDL); diff --git a/common/print.c b/common/print.c index 18c63d803..2306444f8 100644 --- a/common/print.c +++ b/common/print.c @@ -22,7 +22,7 @@ #ifndef lint static char copyright[] = -"$Id: print.c,v 1.34 2000/02/02 07:22:33 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; +"$Id: print.c,v 1.35 2000/02/02 20:01:41 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -1012,8 +1012,8 @@ void print_dns_status (int status, ns_updque *uq) if (s + 1 < end) *s++ = '"'; } - if (s + strlen (u -> r_data) < end) { - strcpy (s, u -> r_data); + if (s + strlen ((char *)u -> r_data) < end) { + strcpy (s, (char *)u -> r_data); s += strlen (s); if (u -> r_type == T_TXT) { if (s + 1 < end) diff --git a/common/tree.c b/common/tree.c index f0dd0283e..b10c6ede3 100644 --- a/common/tree.c +++ b/common/tree.c @@ -22,7 +22,7 @@ #ifndef lint static char copyright[] = -"$Id: tree.c,v 1.73 2000/02/02 08:01:45 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; +"$Id: tree.c,v 1.74 2000/02/02 20:01:41 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -498,12 +498,13 @@ int evaluate_dns_expression (result, packet, lease, in_options, (*result) -> r_data = dmalloc (16, MDL); if (!(*result) -> r_data) goto dpngood; - sprintf ((*result) -> r_data, + sprintf ((char *)(*result) -> r_data, "%d.%d.%d.%d", data.data [0], data.data [1], data.data [2], data.data [3]); (*result) -> r_size = - strlen ((*result) -> r_data); + strlen ((char *) + (*result) -> r_data); } else { (*result) -> r_size = data.len; (*result) -> r_data = dmalloc (data.len, @@ -1806,7 +1807,7 @@ int evaluate_numeric_expression (result, packet, lease, ISC_LIST_UNLINK (uq, tmp, r_link); if (tmp -> r_data) { dfree (tmp -> r_data, MDL); - tmp -> r_data = (char *)0; + tmp -> r_data = (unsigned char *)0; } minires_freeupdrec (tmp); } diff --git a/configure b/configure index 57ff04565..81276a95c 100755 --- a/configure +++ b/configure @@ -45,9 +45,12 @@ if [ "$sysname" = "" ]; then esac;; esac;; SunOS) - case `uname -r` in - 4*) sysname=sunos4;; - 5*) + release=`uname -r` + minor=`echo $release |sed -e 's/.*[0-9]*\.\([0-9][0-9]*\).*$/\1/'` + major=`echo $release |sed -e 's/\([0-9][0-9]*\)\..*$/\1/'` + case $major in + 4) sysname=sunos4;; + 5) set `which gcc` if [ $# = 1 ]; then sysname=sunos5-gcc diff --git a/includes/cf/aix.h b/includes/cf/aix.h index 4e9549fde..d63d9329a 100644 --- a/includes/cf/aix.h +++ b/includes/cf/aix.h @@ -51,7 +51,9 @@ #include #include +#if !defined (h_errno) /* It's a macro on newer instances of AIX. */ extern int h_errno; +#endif #include #include diff --git a/includes/cf/sunos5-5.h b/includes/cf/sunos5-5.h index 29e729396..0b3d7ffbe 100644 --- a/includes/cf/sunos5-5.h +++ b/includes/cf/sunos5-5.h @@ -123,8 +123,10 @@ extern int h_errno; /* Solaris prior to 2.5 didn't have random(). Rather than being clever and using random() only on versions >2.5, always use rand() and srand(). */ +#if SOLARIS_MAJOR == 5 && SOLARIS_MINOR < 5 #define random() rand() #define srandom(x) srand(x) +#endif /* Solaris doesn't provide an endian.h, so we have to do it. */ @@ -150,6 +152,10 @@ extern int h_errno; #define ALIAS_NAMES_PERMUTED +#if SOLARIS_MAJOR == 5 && SOLARIS_MINOR < 7 +typedef int socklen_t; +#endif + #ifdef NEED_PRAND_CONF const char *cmds[] = { "/bin/ps -ef 2>&1", diff --git a/includes/isc/dst.h b/includes/isc/dst.h index ee2a60c42..65c54d24e 100644 --- a/includes/isc/dst.h +++ b/includes/isc/dst.h @@ -7,7 +7,7 @@ typedef struct dst_key { int dk_key_size; /* this is the size of the key in bits */ int dk_proto; /* what protocols this key can be used for */ int dk_alg; /* algorithm number from key record */ - u_int32_t dk_flags; /* and the flags of the public key */ + unsigned dk_flags; /* and the flags of the public key */ unsigned dk_id; /* identifier of the key */ } DST_KEY; #endif /* HAS_DST_KEY */ diff --git a/includes/minires/minires.h b/includes/minires/minires.h index e888720e9..22e575338 100644 --- a/includes/minires/minires.h +++ b/includes/minires/minires.h @@ -155,7 +155,7 @@ int res_nsearch(res_state, const char *, ns_class, ns_type, unsigned char *, unsigned); const char *res_hostalias (const res_state, const char *, char *, size_t); int res_nquerydomain(res_state, const char *, const char *, - ns_class class, ns_class type, unsigned char *, unsigned); + ns_class class, ns_type type, unsigned char *, unsigned); int ns_skiprr(const unsigned char *, const unsigned char *, ns_sect, int); int dn_skipname (const unsigned char *, const unsigned char *);