bug-diffutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-diffutils] [PATCH 1/3] build: rely on gnulib's sigprocmask module


From: Jim Meyering
Subject: [bug-diffutils] [PATCH 1/3] build: rely on gnulib's sigprocmask module
Date: Sun, 09 May 2010 19:30:07 +0200

FYI,

These make diff pass the new syntax-check that I've just
added to gnulib's maint.mk:

>From 6ef1f1f7086021b90c81636de26373c3fe472e5c Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 9 May 2010 18:34:09 +0200
Subject: [PATCH 1/3] build: rely on gnulib's sigprocmask module

* src/sdiff.c: Remove #if-!HAVE_SIGPROCMASK-guarded code.
* bootstrap.conf (gnulib_modules): Add sigprocmask.
---
 bootstrap.conf |    1 +
 src/sdiff.c    |   23 -----------------------
 2 files changed, 1 insertions(+), 23 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index 71fbd3f..aa1e8c3 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -55,6 +55,7 @@ progname
 propername
 regex
 sh-quote
+sigprocmask
 stat-macros
 stat-time
 strcase
diff --git a/src/sdiff.c b/src/sdiff.c
index 4344e8d..c0b35b2 100644
--- a/src/sdiff.c
+++ b/src/sdiff.c
@@ -102,29 +102,6 @@ static int const sigs[] = {
 # define signal_handler(sig, handler) signal (sig, handler)
 #endif

-#if ! HAVE_SIGPROCMASK
-# define sigset_t int
-# define sigemptyset(s) (*(s) = 0)
-# ifndef sigmask
-#  define sigmask(sig) (1 << ((sig) - 1))
-# endif
-# define sigaddset(s, sig) (*(s) |= sigmask (sig))
-# ifndef SIG_BLOCK
-#  define SIG_BLOCK 0
-# endif
-# ifndef SIG_SETMASK
-#  define SIG_SETMASK (! SIG_BLOCK)
-# endif
-# if ! HAVE_SIGBLOCK
-#  define sigblock(mask) (mask)
-#  define sigsetmask(mask) (mask)
-# endif
-# define sigprocmask(how, n, o) \
-    ((how) == SIG_BLOCK \
-     ? ((o) ? (*(sigset_t *) (o) = sigblock (*(n))) : sigblock (*(n))) \
-     : sigsetmask (*(n)))
-#endif
-
 static bool diraccess (char const *);
 static int temporary_file (void);

--
1.7.1.189.g07419


>From bec2cfcd8f73c81219a0f348718b01766e274621 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 9 May 2010 18:39:39 +0200
Subject: [PATCH 2/3] build: don't define macros that gnulib provides

* bootstrap.conf (gnulib_modules): Add signal, stdint.
* lib/cmpbuf.c (SA_RESTART, SA_INTERRUPT): Remove definitions.
(SIZE_MAX, PTRDIFF_MAX): Likewise.
Include <stdint.h>.
* src/system.h (WEXITSTATUS, WIFEXITED): Remove definitions.
(SA_RESTART, SA_INTERRUPT): Likewise.
---
 bootstrap.conf |    2 ++
 lib/cmpbuf.c   |   16 +---------------
 src/system.h   |   13 -------------
 3 files changed, 3 insertions(+), 28 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index aa1e8c3..2f104b3 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -55,9 +55,11 @@ progname
 propername
 regex
 sh-quote
+signal
 sigprocmask
 stat-macros
 stat-time
+stdint
 strcase
 strftime
 strptime
diff --git a/lib/cmpbuf.c b/lib/cmpbuf.c
index 7413210..96ef249 100644
--- a/lib/cmpbuf.c
+++ b/lib/cmpbuf.c
@@ -20,28 +20,14 @@

 #include <errno.h>
 #include <limits.h>
-
 #include <signal.h>
-#ifndef SA_RESTART
-# ifdef SA_INTERRUPT /* e.g. SunOS 4.1.x */
-#  define SA_RESTART SA_INTERRUPT
-# else
-#  define SA_RESTART 0
-# endif
-#endif
-
 #include <unistd.h>
+#include <stdint.h>
 #include <inttypes.h>
 #include <sys/types.h>
 #include "cmpbuf.h"
 #include "intprops.h"

-#ifndef PTRDIFF_MAX
-# define PTRDIFF_MAX TYPE_MAXIMUM (ptrdiff_t)
-#endif
-#ifndef SIZE_MAX
-# define SIZE_MAX TYPE_MAXIMUM (size_t)
-#endif
 #ifndef SSIZE_MAX
 # define SSIZE_MAX TYPE_MAXIMUM (ssize_t)
 #endif
diff --git a/src/system.h b/src/system.h
index 8942296..785a1e9 100644
--- a/src/system.h
+++ b/src/system.h
@@ -54,12 +54,6 @@
 #include <time.h>

 #include <sys/wait.h>
-#ifndef WEXITSTATUS
-# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
-#endif
-#ifndef WIFEXITED
-# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
-#endif

 #include <dirent.h>
 #ifndef _D_EXACT_NAMLEN
@@ -111,13 +105,6 @@ int strcasecmp (char const *, char const *);
 #include <errno.h>

 #include <signal.h>
-#ifndef SA_RESTART
-# ifdef SA_INTERRUPT /* e.g. SunOS 4.1.x */
-#  define SA_RESTART SA_INTERRUPT
-# else
-#  define SA_RESTART 0
-# endif
-#endif
 #if !defined SIGCHLD && defined SIGCLD
 # define SIGCHLD SIGCLD
 #endif
--
1.7.1.189.g07419


>From a0e9e5e67a6a34e131eb392ddb99569bc973748e Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 9 May 2010 19:09:26 +0200
Subject: [PATCH 3/3] build: update gnulib submodule to latest

---
 gnulib |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gnulib b/gnulib
index cbbec35..880f2b6 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit cbbec352566be60d2ede1ee43f6bc911e547d8b0
+Subproject commit 880f2b69df57af506439d6aaf1fe185a6f960e43
--
1.7.1.189.g07419




reply via email to

[Prev in Thread] Current Thread [Next in Thread]