From: Ken Hornstein Date: Fri, 3 Jan 2014 16:43:16 +0000 (-0500) Subject: Garbage collect some Autoconf cruft that has been around a lot longer X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/cfa0a64bc8d5f9dae7d2aebeab0f383a57236743?hp=33d422c45419bacc9e3042c508c443815271053d Garbage collect some Autoconf cruft that has been around a lot longer than necessary. --- diff --git a/configure.ac b/configure.ac index 8db3acf2..750b1e74 100644 --- a/configure.ac +++ b/configure.ac @@ -216,22 +216,6 @@ AS_CASE(["${MD5SUM}"], [MD5FMT="missing"]) AC_SUBST([MD5FMT]) -dnl ---------------------------------------------- -dnl check for lclint, and lint if it doesn't exist -dnl ---------------------------------------------- -AC_CHECK_PROG([linttmp1], [lclint], [lclint], [no])dnl -AS_IF([test x$ac_cv_prog_linttmp1 != xno], - [LINT=$ac_cv_prog_linttmp1 - LINTFLAGS="-weak +posixlib -macrovarprefixexclude"], - [AC_CHECK_PROG([linttmp2], [lint], [lint], [no])dnl - AS_IF([test x$ac_cv_prog_linttmp2 != xno], - [LINT=$ac_cv_prog_linttmp2 - LINTFLAGS=""], - [LINT="echo 'No lint program found'" - LINTFLAGS=""])]) -AC_SUBST([LINT])dnl -AC_SUBST([LINTFLAGS])dnl - dnl Look for `ls' pathtmp=/usr/xpg4/bin:/usr/bin:/bin:/usr/local/bin:/usr/ucb AC_PATH_PROG([lspath], [ls], [no], [$pathtmp]) @@ -311,7 +295,7 @@ dnl If mailspool is not world-writable and dotlockfile is not setgid, dnl we need to #define MAILGROUP to 1 and make inc setgid. if test x"$LOCKTYPE" = x"dot" -a x"$nmh_cv_mailspool_world_writable" = x"no" -a x"$nmh_cv_dotlockfile_setgid" != x"yes" ; then dnl do we really need both of these? - AC_DEFINE(MAILGROUP,1, + AC_DEFINE([MAILGROUP],[1], [Define to 1 if you need to make `inc' set-group-id because your mail spool is not world writable. There are no guarantees as to the safety of doing this, but this #define will add some extra security checks.])dnl SETGID_MAIL=1 fi @@ -322,7 +306,7 @@ AC_CACHE_CHECK(what group owns the mail spool, nmh_cv_ls_mail_grp, [nmh_cv_ls_mail_grp=`$lspath -dL $nmh_cv_ls_grpopt $mailspool|$AWK '{print $4}'` ]) MAIL_SPOOL_GRP=$nmh_cv_ls_mail_grp -AC_SUBST(MAIL_SPOOL_GRP)dnl +AC_SUBST([MAIL_SPOOL_GRP])dnl dnl --------------------------------------------- dnl CHECK FOR PROGRAM TO PROVIDE MIME TYPE STRING @@ -371,7 +355,7 @@ AC_CHECK_HEADER([sys/ptem.h], AC_DEFINE(WINSIZE_IN_PTEM,1, dnl --------------- dnl CHECK FUNCTIONS dnl --------------- -AC_CHECK_FUNCS([wcwidth mbtowc writev lstat nl_langinfo getutxent arc4random]) +AC_CHECK_FUNCS([wcwidth mbtowc nl_langinfo getutxent arc4random]) dnl Check for multibyte character set support AS_IF([test "x$ac_cv_header_wchar_h" = "xyes" -a \ @@ -387,9 +371,6 @@ AC_SUBST([MULTIBYTE_ENABLED]) dnl ------------------- dnl CHECK FOR LIBRARIES dnl ------------------- -dnl Check location of modf -AC_CHECK_FUNC([modf], , AC_CHECK_LIB([m], [modf])) - dnl Checks for network libraries (nsl, socket) NMH_CHECK_NETLIBS @@ -513,85 +494,6 @@ AS_IF([test x"$tls_support" = x"yes"],[ [TLSLIB=]) AC_SUBST([TLSLIB]) -dnl --------------------- -dnl CHECK TERMCAP LIBRARY -dnl --------------------- - -dnl Add the termcap library, so that the following configure -dnl tests will find it when it tries to link test programs. -nmh_save_LIBS="$LIBS" -LIBS="$TERMLIB $LIBS" - -dnl Check if tgetent accepts NULL (and will allocate its own termcap buffer) -dnl Some termcaps reportedly accept a zero buffer, but then dump core -dnl in tgetstr(). -dnl Under Cygwin test program crashes but exit code is still 0. So, -dnl we test for a file that porgram should create -AH_TEMPLATE([TGETENT_ACCEPTS_NULL], -[Define to 1 if tgetent() accepts NULL as a buffer.]) -AC_CACHE_CHECK(if tgetent accepts NULL, -nmh_cv_func_tgetent_accepts_null, -[AC_TRY_RUN([ -main() -{ - char buf[4096]; - int r1 = tgetent(buf, "vt100"); - int r2 = tgetent((char*)0,"vt100"); - if (r1 >= 0 && r1 == r2) { - char tbuf[1024], *u; - u = tbuf; - tgetstr("cl", &u); - creat("conftest.tgetent", 0640); - } - exit((r1 != r2) || r2 == -1); -} -], - if test -f conftest.tgetent; then - nmh_cv_func_tgetent_accepts_null=yes - else - nmh_cv_func_tgetent_accepts_null=no - fi, - nmh_cv_func_tgetent_accepts_null=no, - nmh_cv_func_tgetent_accepts_null=no)]) -if test x$nmh_cv_func_tgetent_accepts_null = xyes; then - AC_DEFINE(TGETENT_ACCEPTS_NULL) -fi -AC_CACHE_CHECK(if tgetent returns 0 on success, -nmh_cv_func_tgetent_zero_success, -[AC_TRY_RUN([ -main() -{ - char buf[4096]; - int r1 = tgetent(buf, "!@#$%^&*"); - int r2 = tgetent(buf, "vt100"); - if (r1 < 0 && r2 == 0) { - char tbuf[1024], *u; - u = tbuf; - tgetstr("cl", &u); - creat("conftest.tgetent0", 0640); - } - exit(r1 == r2); -} -], - if test -f conftest.tgetent0; then - nmh_cv_func_tgetent_zero_success=yes - else - nmh_cv_func_tgetent_zero_success=no - fi, - nmh_cv_func_tgetent_zero_success=no, - nmh_cv_func_tgetent_zero_success=no)]) -AH_TEMPLATE([TGETENT_SUCCESS], -[Define to what tgetent() returns on success (0 on HP-UX X/Open curses).]) -if test x$nmh_cv_func_tgetent_zero_success = xyes; then - AC_DEFINE(TGETENT_SUCCESS, 0) -else - AC_DEFINE(TGETENT_SUCCESS, 1) -fi - -dnl Now put the libraries back to what it was before we -dnl starting checking the termcap library. -LIBS="$nmh_save_LIBS" - dnl ---------------- dnl CHECK FLEX FIXUP dnl ---------------- @@ -608,15 +510,6 @@ true'], true']) AC_SUBST([LFLAGS])]) -dnl -------------- -dnl CHECK TYPEDEFS -dnl -------------- -AC_TYPE_PID_T -AC_TYPE_OFF_T -AC_TYPE_UID_T -AC_TYPE_MODE_T -AC_TYPE_SIZE_T - dnl ---------------- dnl CHECK STRUCTURES dnl ---------------- @@ -654,8 +547,7 @@ dnl exist. dnl AC_CONFIG_COMMANDS([build-directories], -[test -d etc || AS_MKDIR_P([etc]) -test -d man || AS_MKDIR_P([man])]) +[test -d man || AS_MKDIR_P([man])]) AC_CONFIG_COMMANDS_POST([ diff --git a/sbr/error.c b/sbr/error.c index ca73329a..fd74d270 100644 --- a/sbr/error.c +++ b/sbr/error.c @@ -9,10 +9,8 @@ #include -#ifdef HAVE_WRITEV -# include -# include -#endif +#include +#include /* @@ -60,25 +58,16 @@ admonish (char *what, char *fmt, ...) /* * main routine for printing error messages. - * - * Use writev() if available, for slightly better performance. - * Why? Well, there are a couple of reasons. Primarily, it - * gives a smoother output... More importantly though, it's a - * sexy syscall()... */ void advertise (char *what, char *tail, char *fmt, va_list ap) { int eindex = errno; - -#ifdef HAVE_WRITEV char buffer[BUFSIZ], err[BUFSIZ]; struct iovec iob[20], *iov; -#endif fflush (stdout); -#ifdef HAVE_WRITEV fflush (stderr); iov = iob; @@ -118,23 +107,4 @@ advertise (char *what, char *tail, char *fmt, va_list ap) iov->iov_len = strlen (iov->iov_base = "\n"); iov++; writev (fileno (stderr), iob, iov - iob); -#else - if (invo_name && *invo_name) - fprintf (stderr, "%s: ", invo_name); - vfprintf (stderr, fmt, ap); - - if (what) { - char *s; - - if (*what) - fprintf (stderr, " %s: ", what); - if ((s = strerror(eindex))) - fprintf (stderr, "%s", s); - else - fprintf (stderr, "Error %d", eindex); - } - if (tail) - fprintf (stderr, ", %s", tail); - fputc ('\n', stderr); -#endif } diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index 13c7b0bb..03f3e054 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -109,11 +109,7 @@ static void writelscmd(char *, int, char *, char **); static void writesomecmd(char *buf, int bufsz, char *cmd, char *trailcmd, char **argp); static FILE* popen_in_dir(const char *dir, const char *cmd, const char *type); static int system_in_dir(const char *dir, const char *cmd); - - -#ifdef HAVE_LSTAT static int copyf (char *, char *); -#endif int @@ -646,9 +642,7 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp, char *cp, *prog, **vec; struct stat st; -#ifdef HAVE_LSTAT int slinked = 0; -#endif /* HAVE_LSTAT */ /* Was there a previous edit session? */ if (reedit) { @@ -680,16 +674,12 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp, if (atfile) { unlink (linkpath); -#ifdef HAVE_LSTAT if (link (altpath, linkpath) == NOTOK) { symlink (altpath, linkpath); slinked = 1; } else { slinked = 0; } -#else /* not HAVE_LSTAT */ - link (altpath, linkpath); -#endif /* not HAVE_LSTAT */ } } @@ -740,7 +730,6 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp, } reedit++; -#ifdef HAVE_LSTAT if (altmsg && mp && !is_readonly(mp) @@ -753,16 +742,6 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp, && (unlink (altpath) == NOTOK || link (linkpath, altpath) == NOTOK))) advise (linkpath, "unable to update %s from", altmsg); -#else /* HAVE_LSTAT */ - if (altmsg - && mp - && !is_readonly(mp) - && stat (linkpath, &st) != NOTOK - && st.st_nlink == 1 - && (unlink (altpath) == NOTOK - || link (linkpath, altpath) == NOTOK)) - advise (linkpath, "unable to update %s from", altmsg); -#endif /* HAVE_LSTAT */ } /* normally, we remember which editor we used */ @@ -777,7 +756,6 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp, } -#ifdef HAVE_LSTAT static int copyf (char *ifile, char *ofile) { @@ -803,7 +781,6 @@ copyf (char *ifile, char *ofile) close (out); return i; } -#endif /* HAVE_LSTAT */ /*