diff options
author | hpa <hpa> | 2001-11-16 20:15:27 +0000 |
---|---|---|
committer | hpa <hpa> | 2001-11-16 20:15:27 +0000 |
commit | 3d401fa4c9097d9d46f4394c6b9e42481ed6bf98 (patch) | |
tree | ef8f724bb34b7b07c1a0b8703dd7a9297a3f657b | |
parent | 818a5408bdd5b27adbd6ee8e251555753299059e (diff) | |
download | tftp-hpa-3d401fa4c9097d9d46f4394c6b9e42481ed6bf98.tar.gz |
Be paranoid about multiple inclusions (apparently some systems don't like
it for certain header files.) Be a little bit more careful in setting
up the standard environment in config.h. This is AIX portability work.
-rw-r--r-- | aclocal.m4 | 6 | ||||
-rw-r--r-- | config.h | 17 | ||||
-rw-r--r-- | configure.in | 4 | ||||
-rw-r--r-- | tftp/main.c | 14 | ||||
-rw-r--r-- | tftp/tftp.c | 15 | ||||
-rw-r--r-- | tftp/tftpsubs.c | 8 | ||||
-rw-r--r-- | tftpd/misc.c | 1 | ||||
-rw-r--r-- | tftpd/tftpd.c | 16 |
8 files changed, 26 insertions, 55 deletions
@@ -21,8 +21,10 @@ dnl for these particular functions.) dnl -------------------------------------------------------------------------- AC_DEFUN(PA_SIGSETJMP, [AC_MSG_CHECKING([for sigsetjmp]) - AC_TRY_LINK( - [#include <setjmp.h>], + AC_TRY_LINK([ +#ifdef HAVE_SETJMP_H +#include <setjmp.h> +#endif], [sigjmp_buf buf; sigsetjmp(buf,1); siglongjmp(buf,2);], @@ -70,7 +70,24 @@ #include <unistd.h> #endif +#ifdef HAVE_SETJMP_H #include <setjmp.h> +#endif + +#ifdef TIME_WITH_SYS_TIME +#include <sys/time.h> +#include <time.h> +#else +#if HAVE_SYS_TIME_H +#include <sys/time.h> +#else +#include <time.h> +#endif +#endif + +#include <errno.h> +#include <signal.h> + #include <sys/socket.h> /* If we don't have intmax_t, try creating it */ diff --git a/configure.in b/configure.in index a9fab1f..a502d02 100644 --- a/configure.in +++ b/configure.in @@ -58,16 +58,20 @@ AC_CHECK_HEADERS(stdint.h) PA_CHECK_INTTYPES_H_SANE AC_CHECK_HEADERS(libgen.h) AC_CHECK_HEADERS(memory.h) +AC_CHECK_HEADERS(setjmp.h) AC_CHECK_HEADERS(stddef.h) AC_CHECK_HEADERS(stdlib.h) AC_CHECK_HEADERS(string.h) AC_CHECK_HEADERS(strings.h) AC_CHECK_HEADERS(sysexits.h) +AC_CHECK_HEADERS(time.h) AC_CHECK_HEADERS(unistd.h) AC_CHECK_HEADERS(sys/filio.h) AC_CHECK_HEADERS(sys/stat.h) +AC_CHECK_HEADERS(sys/time.h) AC_CHECK_HEADERS(sys/types.h) AC_CHECK_HEADERS(arpa/inet.h) +AC_HEADER_TIME dnl This is needed on some versions of FreeBSD... AC_CHECK_HEADERS(machine/param.h) diff --git a/tftp/main.c b/tftp/main.c index 1b45005..478f3ba 100644 --- a/tftp/main.c +++ b/tftp/main.c @@ -51,23 +51,9 @@ static const char *rcsid UNUSED = /* * TFTP User Program -- Command Interface. */ -#include <sys/types.h> -#include <sys/socket.h> #include <sys/file.h> - -#include <netinet/in.h> - -#include <arpa/inet.h> - #include <ctype.h> -#include <errno.h> #include <netdb.h> -#include <setjmp.h> -#include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> #include <fcntl.h> #ifdef WITH_READLINE #include <readline/readline.h> diff --git a/tftp/tftp.c b/tftp/tftp.c index 017767f..c199f8e 100644 --- a/tftp/tftp.c +++ b/tftp/tftp.c @@ -50,21 +50,6 @@ static const char *rcsid UNUSED = /* * TFTP User Program -- Protocol Machines */ -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/time.h> - -#include <netinet/in.h> - -#include <arpa/tftp.h> - -#include <errno.h> -#include <setjmp.h> -#include <signal.h> -#include <stdio.h> -#include <string.h> -#include <unistd.h> - #include "extern.h" extern struct sockaddr_in peeraddr; /* filled in by main */ diff --git a/tftp/tftpsubs.c b/tftp/tftpsubs.c index c358ccd..3dd34bd 100644 --- a/tftp/tftpsubs.c +++ b/tftp/tftpsubs.c @@ -56,15 +56,7 @@ static const char *rcsid UNUSED = Jim Guyton 10/85 */ -#include <sys/types.h> -#include <sys/socket.h> #include <sys/ioctl.h> -#include <sys/time.h> -#include <netinet/in.h> -#include <arpa/tftp.h> -#include <stdio.h> -#include <string.h> -#include <unistd.h> #define PKTSIZE MAX_SEGSIZE+4 /* should be moved to tftp.h */ diff --git a/tftpd/misc.c b/tftpd/misc.c index 62f2c07..d3c49cd 100644 --- a/tftpd/misc.c +++ b/tftpd/misc.c @@ -17,7 +17,6 @@ #include "config.h" /* Must be included first! */ #include <syslog.h> -#include <signal.h> #include "tftpd.h" /* diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c index dbfd13f..53f607d 100644 --- a/tftpd/tftpd.c +++ b/tftpd/tftpd.c @@ -54,28 +54,14 @@ static const char *rcsid UNUSED = * This version includes many modifications by Jim Guyton <guyton@rand-unix> */ -#include <sys/types.h> #include <sys/ioctl.h> -#include <sys/stat.h> -#include <sys/time.h> #include <signal.h> #include <fcntl.h> - -#include <sys/socket.h> -#include <netinet/in.h> -#include <arpa/tftp.h> #include <netdb.h> - -#include <setjmp.h> -#include <syslog.h> -#include <stdio.h> -#include <errno.h> #include <ctype.h> -#include <string.h> -#include <stdlib.h> #include <pwd.h> -#include <unistd.h> #include <limits.h> +#include <syslog.h> #include "tftpsubs.h" #include "recvfrom.h" |