bug-diffutils
[Top][All Lists]
Advanced

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

[bug-diffutils] bug#31218: kill() not wrapped with HAVE_WORKING_FORK


From: Burton, Ross
Subject: [bug-diffutils] bug#31218: kill() not wrapped with HAVE_WORKING_FORK
Date: Thu, 19 Apr 2018 10:59:44 +0100

Hi,

In sdiff.c the use of kill() is guarded in cleanup():

static void
cleanup (int signo __attribute__((unused)))
{
#if HAVE_WORKING_FORK
  if (0 < diffpid)
    kill (diffpid, SIGPIPE);
#endif
  if (tmpname)
    unlink (tmpname);
}

However, in checksigs() it isn't.  A simple fix to help build
diffutils under mingw (which doesn't have kill()) is:

+--- a/src/sdiff.c
++++ b/src/sdiff.c
+@@ -805,7 +805,9 @@
+
+       /* Yield an exit status indicating that a signal was received.  */
+       untrapsig (s);
++#if HAVE_WORKING_FORK
+       kill (getpid (), s);
++#endif
+
+       /* That didn't work, so exit with error status.  */
+       exit (EXIT_TROUBLE);

Cheers,
Ross





reply via email to

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