From d9cedcfbd2194ff9046d71400cb7878085c26499 Mon Sep 17 00:00:00 2001 From: ian Date: Sun, 5 Oct 1997 17:00:01 +0000 Subject: [PATCH] Portability fixes. --- Changelog | 13 +++++++++++-- INSTALL | 17 +++++++++++++++++ README | 9 +++++++++ acconfig.h | 8 ++++++++ common.h | 6 +++--- configure.in | 14 ++++++++++++++ lexer.l.m4 | 2 ++ overlord.c | 4 ++-- process.c | 2 +- 9 files changed, 67 insertions(+), 8 deletions(-) diff --git a/Changelog b/Changelog index 67de3ca..71a09a4 100644 --- a/Changelog +++ b/Changelog @@ -1,10 +1,19 @@ userv (0.55.2); urgency=low + * Added info about WWW page, mailing lists and bug reporting to README. + * clean targets except realclean don't remove spec.html, spec.ps, lexer.[lc], tokens.h, overview.ps. New totalclean target for removing configure and config.h.in. - - -- + + * Added and to lexer.l.m4. + * instead of ; %d instead of %ld for WEXITSTATUS + in overlord.c; PIPEMAXLEN etc. #defines include cast to int to avoid + problems with sizeof and size_t; EPROTO missing workaround. + * Note about SIG_IGN and `function declaration isn't a prototype' added + to INSTALL file in new PROBLEMS section. + + -- Ian Jackson Sun, 5 Oct 1997 17:55:32 +0100 userv (0.55.1); urgency=low diff --git a/INSTALL b/INSTALL index baf762f..dee9597 100644 --- a/INSTALL +++ b/INSTALL @@ -84,3 +84,20 @@ malloc, unless stdio makes gratuitous mallocs). openlog will already have been called (but syslog will not necessarily have been called). We assume that strerror is completely reentrant. + +PROBLEMS + +* `function declaration isn't a prototype' + + One some systems (at least some versions of NetBSD, for example), + the SIG_IGN and SIG_DFL macros contain function declarations (as part + of a typecast, presumably) which are not prototypes. The warning + options that are used by default if the configure script detects that + you're using a good GCC then cause the compilation to fail. You must + use + make CFLAGS=-O2 + instead of just `make', thus suppressing warnings. + + The bug is actually in your system header files, for not specifying + the number and types of arguments to signal handler functions when + they cast in the SIG_IGN and SIG_DFL macros. diff --git a/README b/README index c327d7a..33d4a03 100644 --- a/README +++ b/README @@ -11,6 +11,15 @@ For installation requirements and instructions please see INSTALL. For usage documentation and discussion see the manual in spec.* (various formats via Debiandoc-SGML in spec.sgml). +The WWW page is . +There are two mailing lists: userv-discuss and userv-announce; both +are managed by majordomo@chiark.greenend.org.uk. Send majordomo the +word `help' for instructions on how to subscribe and unsubscribe. + +Please send bug reports and suggestions to +userv-maint@chiark.greenend.org.uk, or to the userv-discuss mailing +list if you are subscribed to it. + userv is Copyright (C)1996-7 Ian Jackson . userv is free software; you can redistribute it and/or modify it under diff --git a/acconfig.h b/acconfig.h index 160a27c..6e2356e 100644 --- a/acconfig.h +++ b/acconfig.h @@ -19,6 +19,9 @@ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* Define if EPROTO exists. */ +#undef HAVE_EPROTO + /* Define if function attributes a la GCC 2.5 and higher are available. */ #undef HAVE_GNUC25_ATTRIB @@ -33,6 +36,11 @@ @BOTTOM@ +/* EPROTO */ +#ifndef HAVE_EPROTO +#define EPROTO 0 +#endif + /* GNU C attributes. */ #ifndef FUNCATTR #ifdef HAVE_GNUC25_ATTRIB diff --git a/common.h b/common.h index 2a2db41..f73ea4d 100644 --- a/common.h +++ b/common.h @@ -43,13 +43,13 @@ static const unsigned char protocolchecksumversion[PCSUMSIZE]= { #ifndef PIPEFORMAT # define PIPEFORMAT "%lx.%lx.%x" # define PIPEPATTERN "[0-9a-f]*.[0-9a-f]*.*[0-9a-f]" -# define PIPEFORMATEXTEND (sizeof(unsigned long)*2*2+sizeof(int)*2+3) -# define PIPEMAXLEN (sizeof(PIPEFORMAT)+PIPEFORMATEXTEND) +# define PIPEFORMATEXTEND ((int)(sizeof(unsigned long)*2*2+(int)sizeof(int)*2+3)) +# define PIPEMAXLEN ((int)(sizeof(PIPEFORMAT)+PIPEFORMATEXTEND)) #endif #ifndef PIPEPATHFORMAT # define PIPEPATHFORMAT VARDIR "/" PIPEFORMAT -# define PIPEPATHMAXLEN (sizeof(PIPEPATHFORMAT)+PIPEFORMATEXTEND) +# define PIPEPATHMAXLEN ((int)(sizeof(PIPEPATHFORMAT)+PIPEFORMATEXTEND)) #endif #define MAX_ALLOW_FD 1024 diff --git a/configure.in b/configure.in index 86ce18f..7b842ce 100644 --- a/configure.in +++ b/configure.in @@ -39,8 +39,22 @@ AC_ARG_ENABLE(debug, ]) AC_PROG_CC +AC_PROG_CPP AC_PROG_INSTALL +AC_CACHE_CHECK(for EPROTO,userv_cv_hdr_eproto, + AC_EGREP_CPP(yes, +[ +#include +#ifdef EPROTO + yes +#endif +],userv_cv_hdr_eproto=yes,userv_cv_hdr_eproto=no)) +if test $userv_cv_hdr_eproto = yes +then + AC_DEFINE(HAVE_EPROTO) +fi + AC_SUBST(OPTIMISE) if test "${GCC-no}" = yes; then OPTIMISE=-O2 diff --git a/lexer.l.m4 b/lexer.l.m4 index 849f233..0b7e705 100644 --- a/lexer.l.m4 +++ b/lexer.l.m4 @@ -33,8 +33,10 @@ include(language.i4) #include #include #include +#include #include #include +#include #include "config.h" #include "common.h" diff --git a/overlord.c b/overlord.c index 7f66c4e..241bb0d 100644 --- a/overlord.c +++ b/overlord.c @@ -19,7 +19,6 @@ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include #include #include @@ -28,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -94,7 +94,7 @@ static void sighandler_chld(int x) { (long)r,status); } else if (WEXITSTATUS(status)>12) { if (WEXITSTATUS(status)>24) - syslog(LOG_ERR,"call pid %ld exited with status %ld >24", + syslog(LOG_ERR,"call pid %ld exited with status %d >24", (long)r,WEXITSTATUS(status)); checkstalepipes(); } diff --git a/process.c b/process.c index 35eba59..c88c3c9 100644 --- a/process.c +++ b/process.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -52,6 +51,7 @@ #include #include #include +#include #include #include #include -- 2.30.2