bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: sdiff code error


From: Paul Eggert
Subject: Re: sdiff code error
Date: Sat, 04 Nov 2006 17:59:00 -0800
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

"Paul Edwards" <address@hidden> writes:

> I'm porting a lot of stuff to MVS 3.8 (IBM mainframe),

Thanks for reporting the bug.  I have installed the following patch.

Incidentally, the code in question was introduced in diffutils 2.7.2
(published 1998-09-14) so it appears you're the first person since
1998 (and the first person ever) to build diffutils on a host without
sigprocmask.

> It is a pure C89 environment.

In that case, you're probably still in trouble even with this fix, no?
C89 doesn't have sigblock or sigsetmask.

> Text processing utilities should be
> C89-compliant by default.

sdiff does more than that: it interacts with the user, who can
interrupt it, and sdiff needs to treat the interrupts safely.

2006-11-04  Paul Eggert  <address@hidden>

        * src/sdiff.c (sigprocmask) [! HAVE_SIGPROCMASK]: Cast 2nd arg to
        sigset_t *, since it might be a literal 0.  Problem reported by
        Paul Edwards for MVS 3.8.

Index: src/sdiff.c
===================================================================
RCS file: /cvsroot/diffutils/diffutils/src/sdiff.c,v
retrieving revision 1.43
diff -p -u -r1.43 sdiff.c
--- src/sdiff.c 13 Mar 2006 19:11:17 -0000      1.43
+++ src/sdiff.c 5 Nov 2006 00:57:19 -0000
@@ -112,7 +112,9 @@ static int const sigs[] = {
 #  define SIG_SETMASK (! SIG_BLOCK)
 # endif
 # define sigprocmask(how, n, o) \
-    ((how) == SIG_BLOCK ? *(o) = sigblock (*(n)) : sigsetmask (*(n)))
+    ((how) == SIG_BLOCK \
+     ? *(sigset_t *) (o) = sigblock (*(n)) \
+     : sigsetmask (*(n)))
 #endif
 
 static bool diraccess (char const *);




reply via email to

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