From d1b702b1220d45e441b2b9597a8cf58edb51a653 Mon Sep 17 00:00:00 2001 From: Lyndon Nerenberg Date: Sat, 24 Dec 2011 15:40:48 -0800 Subject: [PATCH] Eliminate '#ifdef HAVE_FOO' for Posix-mandated FOOs. --- h/nmh.h | 34 +++------------------------------- h/prototypes.h | 8 -------- sbr/client.c | 5 +---- sbr/lock_file.c | 5 +---- uip/dropsbr.c | 5 +---- uip/mhlsbr.c | 5 +---- uip/rcvtty.c | 2 +- uip/slocal.c | 2 +- 8 files changed, 9 insertions(+), 57 deletions(-) diff --git a/h/nmh.h b/h/nmh.h index f1711d5..c354482 100644 --- a/h/nmh.h +++ b/h/nmh.h @@ -5,11 +5,7 @@ #include -#ifdef HAVE_UNISTD_H -# include -# include -#endif - +#include #include #include #include @@ -31,34 +27,16 @@ # endif #endif -#ifdef HAVE_STDLIB_H -# include -#endif - +#include #include - -#if STDC_HEADERS || HAVE_STRING_H -# include -/* An ANSI string.h and pre-ANSI memory.h might conflict. */ -# if !STDC_HEADERS && HAVE_MEMORY_H -# include -# endif /* not STDC_HEADERS and HAVE_MEMORY_H */ -#else /* not STDC_HEADERS and not HAVE_STRING_H */ -# include -/* memory.h and strings.h conflict on some systems. */ -#endif /* not STDC_HEADERS and not HAVE_STRING_H */ +#include #ifdef HAVE_SYS_PARAM_H # include #endif -#ifdef HAVE_LOCALE_H # include -#endif - -#ifdef HAVE_LIMITS_H # include -#endif /* * symbolic constants for lseek and fseek @@ -115,12 +93,6 @@ #define bcpy(b1,b2,length) memcmp (b1, b2, length) #define bzero(b,length) memset (b, 0, length) -#ifdef HAVE_KILLPG -# define KILLPG(pgrp,sig) killpg(pgrp,sig); -#else -# define KILLPG(pgrp,sig) kill((-pgrp),sig); -#endif - /* * If your stat macros are broken, * we will just undefine them. diff --git a/h/prototypes.h b/h/prototypes.h index 1bc19d4..d88cf8e 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -131,14 +131,6 @@ char *write_charset_8bit (void); int get_returnpath (char *, int, char *, int); #endif -/* - * prototypes for compatibility functions in library - */ -#ifndef HAVE_SNPRINTF_PROTOTYPE -int snprintf (char *, size_t, const char *, ...); -int vsnprintf (char *, size_t, const char *, va_list); -#endif - int mh_strcasecmp (const char *s1, const char *s2); int strncasecmp (const char *s1, const char *s2, size_t n); diff --git a/sbr/client.c b/sbr/client.c index c558536..763b2a4 100644 --- a/sbr/client.c +++ b/sbr/client.c @@ -14,10 +14,7 @@ #include #include #include - -#ifdef HAVE_ARPA_INET_H -# include -#endif +#include #define TRUE 1 #define FALSE 0 diff --git a/sbr/lock_file.c b/sbr/lock_file.c index 51576ea..0e14e8d 100644 --- a/sbr/lock_file.c +++ b/sbr/lock_file.c @@ -29,10 +29,7 @@ # include # endif #endif - -#ifdef HAVE_ERRNO_H -# include -#endif +#include #ifdef HAVE_FCNTL_H # include diff --git a/uip/dropsbr.c b/uip/dropsbr.c index 76bc00d..11ceba8 100644 --- a/uip/dropsbr.c +++ b/uip/dropsbr.c @@ -14,10 +14,7 @@ #include #include #include - -#ifdef HAVE_ERRNO_H -# include -#endif +#include #ifdef NTOHLSWAP # include diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index 58b2978..d1204c7 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -1515,10 +1515,7 @@ face_format (struct mcomp *c1) #include #include #include - -#ifdef HAVE_ARPA_INET_H -# include -#endif +#include static int doface (struct mcomp *c1) diff --git a/uip/rcvtty.c b/uip/rcvtty.c index 8b04d61..219af22 100644 --- a/uip/rcvtty.c +++ b/uip/rcvtty.c @@ -263,7 +263,7 @@ message_fd (char **vec) * Ruthlessly kill the child and anything * else in its process group. */ - KILLPG(child_id, SIGKILL); + killpg(child_id, SIGKILL); } close (fd); return header_fd (); diff --git a/uip/slocal.c b/uip/slocal.c index e6880fe..cf91737 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -1206,7 +1206,7 @@ usr_pipe (int fd, char *cmd, char *pgm, char **vec, int suppress) * Ruthlessly kill the child and anything * else in its process group. */ - KILLPG(child_id, SIGKILL); + killpg(child_id, SIGKILL); if (verbose) verbose_printf (", timed-out; terminated\n"); return -1; -- 1.7.10.4