]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Minor solaris fixes.
authorTed Lemon <source@isc.org>
Wed, 2 Feb 2000 20:01:50 +0000 (20:01 +0000)
committerTed Lemon <source@isc.org>
Wed, 2 Feb 2000 20:01:50 +0000 (20:01 +0000)
Makefile.conf
client/dhclient.c
common/execute.c
common/print.c
common/tree.c
configure
includes/cf/aix.h
includes/cf/sunos5-5.h
includes/isc/dst.h
includes/minires/minires.h

index e41012a1dffc8abb2c9d5909939f586670dd7fad..f8ba9382bdd265597a72744f9db4bcd6aee610cf 100644 (file)
@@ -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
index 9c18c47dba43c13b049fec7019f6762336bde0bc..f5e9018cf84937cbcc594e26a8e826246f9da336 100644 (file)
@@ -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);
        }
 
index 8f3a4e22112c57fa160364e0a9101b15a889045a..9c499477bf73e86b511a626316e7269648b63cf4 100644 (file)
@@ -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);
index 18c63d80358a7ddb82f98716fa3feaac804593e2..2306444f8c5f4dfbe4e277795dde0988690092b0 100644 (file)
@@ -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)
index f0dd0283e9d4cbda5ef0b7be700980d35e379174..b10c6ede388f40ce68f4e1b5cfdd8ab3ff16dc55 100644 (file)
@@ -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);
                }
index 57ff04565a9e99b727a31523495155777ae6eb30..81276a95c306a45aeaa6683bff7847aed65ed0e8 100755 (executable)
--- 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
index 4e9549fdeca1a55e416b91faf8bbbc1aba7cb737..d63d9329adbef96fa5f94ac34146fd13d43415a0 100644 (file)
@@ -51,7 +51,9 @@
 #include <setjmp.h>
 #include <limits.h>
 
+#if !defined (h_errno) /* It's a macro on newer instances of AIX. */
 extern int h_errno;
+#endif
 
 #include <net/if.h>
 #include <net/if_arp.h>
index 29e729396c3fc0025d078ddcf8a75d61a460ebde..0b3d7ffbe34cf5104a6638077396d0fa2c53e096 100644 (file)
@@ -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",
index ee2a60c42dc37575c17c698560417284956200c9..65c54d24ebabe3344566a93c44f107f40e4a6f46 100644 (file)
@@ -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 */
index e888720e927281c9357ff473be58b51a31c6dbd4..22e57533826b5d66dbaa2272d724ecc4b36eb04a 100644 (file)
@@ -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 *);