[tz] [PROPOSED] Do not include sys/wait.h

Paul Eggert eggert at cs.ucla.edu
Thu Jul 15 21:00:59 UTC 2021


This cleans up some code no longer needed now that we’ve dropped
support for zic -y.  Issue noted by spazmodius in:
https://github.com/eggert/tz/commit/284e877d7511d964249ecfd2e75a9cab85e2741a#commitcomment-53546681
* Makefile, NEWS: Update commentary.
* private.h (HAVE_SYS_WAIT_H): Remove.  All uses removed.
* zic.c: Do not include sys/wait.h.
(WIFEXITED, WEXITSTATUS): Remove; unused.
---
 Makefile  |  1 -
 NEWS      |  3 +++
 private.h |  4 ----
 zic.c     | 11 -----------
 4 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/Makefile b/Makefile
index 77ef331..f441fce 100644
--- a/Makefile
+++ b/Makefile
@@ -222,7 +222,6 @@ LDLIBS=
 #  -DHAVE_STRTOLL=0 if your system lacks the strtoll function
 #  -DHAVE_SYMLINK=0 if your system lacks the symlink function
 #  -DHAVE_SYS_STAT_H=0 if your compiler lacks a <sys/stat.h>
-#  -DHAVE_SYS_WAIT_H=0 if your compiler lacks a <sys/wait.h>
 #  -DHAVE_TZSET=0 if your system lacks a tzset function
 #  -DHAVE_UNISTD_H=0 if your compiler lacks a <unistd.h>
 #  -Dlocale_t=XXX if your system uses XXX instead of locale_t
diff --git a/NEWS b/NEWS
index 53890a7..f53e431 100644
--- a/NEWS
+++ b/NEWS
@@ -124,6 +124,9 @@ Unreleased, experimental changes
     "EST5EDT,0/0,J365/25" or "".  (Thanks to Michael Deckers for
     noting the possibility of POSIX conformance.)
 
+    zic.c no longer requires sys/wait.h (thanks to spazmodius for
+    noting it wasn't needed).
+
     When reading slim TZif files, zdump no longer mishandles leap
     seconds on the rare platforms where time_t counts leap seconds,
     fixing a bug introduced in 2014g.
diff --git a/private.h b/private.h
index 340a354..6425298 100644
--- a/private.h
+++ b/private.h
@@ -90,10 +90,6 @@
 #define HAVE_SYS_STAT_H		1
 #endif /* !defined HAVE_SYS_STAT_H */
 
-#ifndef HAVE_SYS_WAIT_H
-#define HAVE_SYS_WAIT_H		1
-#endif /* !defined HAVE_SYS_WAIT_H */
-
 #ifndef HAVE_UNISTD_H
 #define HAVE_UNISTD_H		1
 #endif /* !defined HAVE_UNISTD_H */
diff --git a/zic.c b/zic.c
index 77a5698..8d1ea03 100644
--- a/zic.c
+++ b/zic.c
@@ -48,17 +48,6 @@ typedef int_fast64_t	zic_t;
 #define MKDIR_UMASK 0755
 #endif
 
-#if HAVE_SYS_WAIT_H
-#include <sys/wait.h>	/* for WIFEXITED and WEXITSTATUS */
-#endif /* HAVE_SYS_WAIT_H */
-
-#ifndef WIFEXITED
-#define WIFEXITED(status)	(((status) & 0xff) == 0)
-#endif /* !defined WIFEXITED */
-#ifndef WEXITSTATUS
-#define WEXITSTATUS(status)	(((status) >> 8) & 0xff)
-#endif /* !defined WEXITSTATUS */
-
 /* The maximum ptrdiff_t value, for pre-C99 platforms.  */
 #ifndef PTRDIFF_MAX
 static ptrdiff_t const PTRDIFF_MAX = MAXVAL(ptrdiff_t, TYPE_BIT(ptrdiff_t));
-- 
2.31.1



More information about the tz mailing list