to determine whether `sigaction' functions are available.
Reported by Paul Nevai <nevai@ops.mps.ohio-state.edu>.
Fix suggested by Karl Berry.
char **argv;
{
int optc;
-#ifdef _POSIX_VERSION
+#ifdef SA_INTERRUPT
struct sigaction oldact, newact;
-#endif /* _POSIX_VERSION */
+#endif /* SA_INTERRUPT */
program_name = argv[0];
global_argv = argv;
remove_files = TRUE;
prefix = DEFAULT_PREFIX;
-#ifdef _POSIX_VERSION
+#ifdef SA_INTERRUPT
newact.sa_handler = interrupt_handler;
sigemptyset (&newact.sa_mask);
newact.sa_flags = 0;
sigaction (SIGTERM, NULL, &oldact);
if (oldact.sa_handler != SIG_IGN)
sigaction (SIGTERM, &newact, NULL);
-#else /* !_POSIX_VERSION */
+#else
if (signal (SIGHUP, SIG_IGN) != SIG_IGN)
signal (SIGHUP, interrupt_handler);
if (signal (SIGINT, SIG_IGN) != SIG_IGN)
#include "long-options.h"
#include "error.h"
-#ifdef _POSIX_VERSION
+#ifdef HAVE_LIMITS_H
#include <limits.h>
#else
#ifndef UCHAR_MAX
sighandler (sig)
int sig;
{
-#ifdef _POSIX_VERSION
+#ifdef SA_INTERRUPT
struct sigaction sigact;
sigact.sa_handler = SIG_DFL;
sigemptyset (&sigact.sa_mask);
sigact.sa_flags = 0;
sigaction (sig, &sigact, NULL);
-#else /* !_POSIX_VERSION */
+#else /* !SA_INTERRUPT */
signal (sig, SIG_DFL);
-#endif /* _POSIX_VERSION */
+#endif /* SA_INTERRUPT */
cleanup ();
kill (getpid (), sig);
}
int checkonly = 0, mergeonly = 0, nfiles = 0;
char *minus = "-", *outfile = minus, **files, *tmp;
FILE *ofp;
-#ifdef _POSIX_VERSION
+#ifdef SA_INTERRUPT
struct sigaction oldact, newact;
-#endif /* _POSIX_VERSION */
+#endif /* SA_INTERRUPT */
program_name = argv[0];
if (temp_file_prefix == NULL)
temp_file_prefix = DEFAULT_TMPDIR;
-#ifdef _POSIX_VERSION
+#ifdef SA_INTERRUPT
newact.sa_handler = sighandler;
sigemptyset (&newact.sa_mask);
newact.sa_flags = 0;
sigaction (SIGTERM, NULL, &oldact);
if (oldact.sa_handler != SIG_IGN)
sigaction (SIGTERM, &newact, NULL);
-#else /* !_POSIX_VERSION */
+#else /* !SA_INTERRUPT */
if (signal (SIGINT, SIG_IGN) != SIG_IGN)
signal (SIGINT, sighandler);
if (signal (SIGHUP, SIG_IGN) != SIG_IGN)
signal (SIGPIPE, sighandler);
if (signal (SIGTERM, SIG_IGN) != SIG_IGN)
signal (SIGTERM, sighandler);
-#endif /* !_POSIX_VERSION */
+#endif /* !SA_INTERRUPT */
gkey.sword = gkey.eword = -1;
gkey.ignore = NULL;
RETSIGTYPE (*sigint) (), (*sighup) (), (*sigpipe) (), (*sigterm) ();
int errors;
struct stat stats;
-#ifdef _POSIX_VERSION
+#ifdef SA_INTERRUPT
struct sigaction oldact, newact;
-#endif /* _POSIX_VERSION */
+#endif /* SA_INTERRUPT */
/* No tempfile is needed for "tac < file".
Use fstat instead of checking for errno == ESPIPE because
if (S_ISREG (stats.st_mode))
return tac (0, _("standard input"));
-#ifdef _POSIX_VERSION
+#ifdef SA_INTERRUPT
newact.sa_handler = cleanup;
sigemptyset (&newact.sa_mask);
newact.sa_flags = 0;
sigterm = oldact.sa_handler;
if (sigterm != SIG_IGN)
sigaction (SIGTERM, &newact, NULL);
-#else /* !_POSIX_VERSION */
+#else /* !SA_INTERRUPT */
sigint = signal (SIGINT, SIG_IGN);
if (sigint != SIG_IGN)
signal (SIGINT, cleanup);
sigterm = signal (SIGTERM, SIG_IGN);
if (sigterm != SIG_IGN)
signal (SIGTERM, cleanup);
-#endif /* _POSIX_VERSION */
+#endif /* SA_INTERRUPT */
save_stdin ();
unlink (tempfile);
-#ifdef _POSIX_VERSION
+#ifdef SA_INTERRUPT
newact.sa_handler = sigint;
sigaction (SIGINT, &newact, NULL);
newact.sa_handler = sighup;
sigaction (SIGTERM, &newact, NULL);
newact.sa_handler = sigpipe;
sigaction (SIGPIPE, &newact, NULL);
-#else /* !_POSIX_VERSION */
+#else /* !SA_INTERRUPT */
signal (SIGINT, sigint);
signal (SIGHUP, sighup);
signal (SIGTERM, sigterm);
signal (SIGPIPE, sigpipe);
-#endif /* _POSIX_VERSION */
+#endif /* SA_INTERRUPT */
return errors;
}