forked from mirrors/tftp-hpa-google
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.
This commit is contained in:
parent
818a5408bd
commit
3d401fa4c9
8 changed files with 26 additions and 55 deletions
6
aclocal.m4
vendored
6
aclocal.m4
vendored
|
@ -21,8 +21,10 @@ dnl for these particular functions.)
|
||||||
dnl --------------------------------------------------------------------------
|
dnl --------------------------------------------------------------------------
|
||||||
AC_DEFUN(PA_SIGSETJMP,
|
AC_DEFUN(PA_SIGSETJMP,
|
||||||
[AC_MSG_CHECKING([for sigsetjmp])
|
[AC_MSG_CHECKING([for sigsetjmp])
|
||||||
AC_TRY_LINK(
|
AC_TRY_LINK([
|
||||||
[#include <setjmp.h>],
|
#ifdef HAVE_SETJMP_H
|
||||||
|
#include <setjmp.h>
|
||||||
|
#endif],
|
||||||
[sigjmp_buf buf;
|
[sigjmp_buf buf;
|
||||||
sigsetjmp(buf,1);
|
sigsetjmp(buf,1);
|
||||||
siglongjmp(buf,2);],
|
siglongjmp(buf,2);],
|
||||||
|
|
17
config.h
17
config.h
|
@ -70,7 +70,24 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_SETJMP_H
|
||||||
#include <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>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
/* If we don't have intmax_t, try creating it */
|
/* If we don't have intmax_t, try creating it */
|
||||||
|
|
|
@ -58,16 +58,20 @@ AC_CHECK_HEADERS(stdint.h)
|
||||||
PA_CHECK_INTTYPES_H_SANE
|
PA_CHECK_INTTYPES_H_SANE
|
||||||
AC_CHECK_HEADERS(libgen.h)
|
AC_CHECK_HEADERS(libgen.h)
|
||||||
AC_CHECK_HEADERS(memory.h)
|
AC_CHECK_HEADERS(memory.h)
|
||||||
|
AC_CHECK_HEADERS(setjmp.h)
|
||||||
AC_CHECK_HEADERS(stddef.h)
|
AC_CHECK_HEADERS(stddef.h)
|
||||||
AC_CHECK_HEADERS(stdlib.h)
|
AC_CHECK_HEADERS(stdlib.h)
|
||||||
AC_CHECK_HEADERS(string.h)
|
AC_CHECK_HEADERS(string.h)
|
||||||
AC_CHECK_HEADERS(strings.h)
|
AC_CHECK_HEADERS(strings.h)
|
||||||
AC_CHECK_HEADERS(sysexits.h)
|
AC_CHECK_HEADERS(sysexits.h)
|
||||||
|
AC_CHECK_HEADERS(time.h)
|
||||||
AC_CHECK_HEADERS(unistd.h)
|
AC_CHECK_HEADERS(unistd.h)
|
||||||
AC_CHECK_HEADERS(sys/filio.h)
|
AC_CHECK_HEADERS(sys/filio.h)
|
||||||
AC_CHECK_HEADERS(sys/stat.h)
|
AC_CHECK_HEADERS(sys/stat.h)
|
||||||
|
AC_CHECK_HEADERS(sys/time.h)
|
||||||
AC_CHECK_HEADERS(sys/types.h)
|
AC_CHECK_HEADERS(sys/types.h)
|
||||||
AC_CHECK_HEADERS(arpa/inet.h)
|
AC_CHECK_HEADERS(arpa/inet.h)
|
||||||
|
AC_HEADER_TIME
|
||||||
dnl This is needed on some versions of FreeBSD...
|
dnl This is needed on some versions of FreeBSD...
|
||||||
AC_CHECK_HEADERS(machine/param.h)
|
AC_CHECK_HEADERS(machine/param.h)
|
||||||
|
|
||||||
|
|
14
tftp/main.c
14
tftp/main.c
|
@ -51,23 +51,9 @@ static const char *rcsid UNUSED =
|
||||||
/*
|
/*
|
||||||
* TFTP User Program -- Command Interface.
|
* TFTP User Program -- Command Interface.
|
||||||
*/
|
*/
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <sys/file.h>
|
#include <sys/file.h>
|
||||||
|
|
||||||
#include <netinet/in.h>
|
|
||||||
|
|
||||||
#include <arpa/inet.h>
|
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <errno.h>
|
|
||||||
#include <netdb.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>
|
#include <fcntl.h>
|
||||||
#ifdef WITH_READLINE
|
#ifdef WITH_READLINE
|
||||||
#include <readline/readline.h>
|
#include <readline/readline.h>
|
||||||
|
|
15
tftp/tftp.c
15
tftp/tftp.c
|
@ -50,21 +50,6 @@ static const char *rcsid UNUSED =
|
||||||
/*
|
/*
|
||||||
* TFTP User Program -- Protocol Machines
|
* 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"
|
#include "extern.h"
|
||||||
|
|
||||||
extern struct sockaddr_in peeraddr; /* filled in by main */
|
extern struct sockaddr_in peeraddr; /* filled in by main */
|
||||||
|
|
|
@ -56,15 +56,7 @@ static const char *rcsid UNUSED =
|
||||||
Jim Guyton 10/85
|
Jim Guyton 10/85
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <sys/ioctl.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 */
|
#define PKTSIZE MAX_SEGSIZE+4 /* should be moved to tftp.h */
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
|
|
||||||
#include "config.h" /* Must be included first! */
|
#include "config.h" /* Must be included first! */
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include <signal.h>
|
|
||||||
#include "tftpd.h"
|
#include "tftpd.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -54,28 +54,14 @@ static const char *rcsid UNUSED =
|
||||||
* This version includes many modifications by Jim Guyton <guyton@rand-unix>
|
* This version includes many modifications by Jim Guyton <guyton@rand-unix>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <arpa/tftp.h>
|
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <syslog.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <unistd.h>
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <syslog.h>
|
||||||
|
|
||||||
#include "tftpsubs.h"
|
#include "tftpsubs.h"
|
||||||
#include "recvfrom.h"
|
#include "recvfrom.h"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue