2016-09-16 13:10:58 +02:00
|
|
|
---
|
|
|
|
array.c | 2 +-
|
|
|
|
examples/loadables/tee.c | 3 ++-
|
|
|
|
hashlib.c | 2 +-
|
|
|
|
jobs.c | 9 +++++++++
|
|
|
|
sig.c | 4 ++--
|
|
|
|
sig.h | 4 ++--
|
|
|
|
6 files changed, 17 insertions(+), 7 deletions(-)
|
|
|
|
|
2010-02-18 12:17:29 +01:00
|
|
|
--- array.c
|
2017-01-27 18:54:19 +01:00
|
|
|
+++ array.c 2017-01-27 17:45:42.364066849 +0000
|
2016-09-16 13:10:58 +02:00
|
|
|
@@ -946,7 +946,7 @@ char *s, *sep;
|
2006-12-15 18:03:59 +01:00
|
|
|
* To make a running version, compile -DTEST_ARRAY and link with:
|
|
|
|
* xmalloc.o syntax.o lib/malloc/libmalloc.a lib/sh/libsh.a
|
|
|
|
*/
|
|
|
|
-int interrupt_immediately = 0;
|
|
|
|
+volatile sig_atomic_t interrupt_immediately = 0;
|
|
|
|
|
|
|
|
int
|
|
|
|
signal_is_trapped(s)
|
2011-03-08 13:18:13 +01:00
|
|
|
--- examples/loadables/tee.c
|
2017-01-27 18:54:19 +01:00
|
|
|
+++ examples/loadables/tee.c 2017-01-27 17:45:42.364066849 +0000
|
2011-03-08 13:18:13 +01:00
|
|
|
@@ -35,6 +35,7 @@
|
|
|
|
#include "bashansi.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
+#include <signal.h>
|
|
|
|
#include <errno.h>
|
|
|
|
|
|
|
|
#include "builtins.h"
|
|
|
|
@@ -56,7 +57,7 @@ static FLIST *tee_flist;
|
|
|
|
|
|
|
|
#define TEE_BUFSIZE 8192
|
|
|
|
|
|
|
|
-extern int interrupt_immediately;
|
|
|
|
+extern volatile sig_atomic_t interrupt_immediately;
|
|
|
|
|
|
|
|
extern char *strerror ();
|
|
|
|
|
2010-02-18 12:17:29 +01:00
|
|
|
--- hashlib.c
|
2017-01-27 18:54:19 +01:00
|
|
|
+++ hashlib.c 2017-01-27 17:45:42.364066849 +0000
|
2016-09-16 13:10:58 +02:00
|
|
|
@@ -382,7 +382,7 @@ hash_pstats (table, name)
|
2006-12-15 18:03:59 +01:00
|
|
|
|
|
|
|
HASH_TABLE *table, *ntable;
|
|
|
|
|
|
|
|
-int interrupt_immediately = 0;
|
|
|
|
+volatile sig_atomic_t interrupt_immediately = 0;
|
|
|
|
|
|
|
|
int
|
|
|
|
signal_is_trapped (s)
|
2010-02-18 12:17:29 +01:00
|
|
|
--- jobs.c
|
2017-01-27 18:54:19 +01:00
|
|
|
+++ jobs.c 2017-01-27 17:45:42.364066849 +0000
|
|
|
|
@@ -1962,6 +1962,15 @@ make_child (command, async_p)
|
2006-12-15 18:03:59 +01:00
|
|
|
pid_t mypid;
|
|
|
|
|
|
|
|
mypid = getpid ();
|
|
|
|
+
|
|
|
|
+ if (interrupt_state)
|
|
|
|
+ {
|
|
|
|
+ struct timeval tv;
|
|
|
|
+ struct rusage rx;
|
|
|
|
+ (void) gettimeofday(&tv, NULL);
|
|
|
|
+ (void) getrusage(RUSAGE_SELF, &rx);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
#if defined (BUFFERED_INPUT)
|
|
|
|
/* Close default_buffered_input if it's > 0. We don't close it if it's
|
|
|
|
0 because that's the file descriptor used when redirecting input,
|
2010-02-18 12:17:29 +01:00
|
|
|
--- sig.c
|
2017-01-27 18:54:19 +01:00
|
|
|
+++ sig.c 2017-01-27 17:45:42.364066849 +0000
|
2016-09-16 13:10:58 +02:00
|
|
|
@@ -98,10 +98,10 @@ sigset_t top_level_mask;
|
2006-12-15 18:03:59 +01:00
|
|
|
#endif /* JOB_CONTROL */
|
|
|
|
|
|
|
|
/* When non-zero, we throw_to_top_level (). */
|
|
|
|
-int interrupt_immediately = 0;
|
|
|
|
+volatile sig_atomic_t interrupt_immediately = 0;
|
|
|
|
|
|
|
|
/* When non-zero, we call the terminating signal handler immediately. */
|
|
|
|
-int terminate_immediately = 0;
|
|
|
|
+volatile sig_atomic_t terminate_immediately = 0;
|
|
|
|
|
|
|
|
#if defined (SIGWINCH)
|
|
|
|
static SigHandler *old_winch = (SigHandler *)SIG_DFL;
|
2010-02-18 12:17:29 +01:00
|
|
|
--- sig.h
|
2017-01-27 18:54:19 +01:00
|
|
|
+++ sig.h 2017-01-27 17:45:42.364066849 +0000
|
2016-09-16 13:10:58 +02:00
|
|
|
@@ -109,8 +109,8 @@ do { \
|
2014-10-22 14:53:54 +02:00
|
|
|
extern volatile sig_atomic_t sigwinch_received;
|
|
|
|
extern volatile sig_atomic_t sigterm_received;
|
2006-12-15 18:03:59 +01:00
|
|
|
|
2014-10-22 14:53:54 +02:00
|
|
|
-extern int interrupt_immediately; /* no longer used */
|
2006-12-15 18:03:59 +01:00
|
|
|
-extern int terminate_immediately;
|
2014-10-22 14:53:54 +02:00
|
|
|
+extern volatile sig_atomic_t interrupt_immediately; /* no longer used */
|
2006-12-15 18:03:59 +01:00
|
|
|
+extern volatile sig_atomic_t terminate_immediately;
|
|
|
|
|
|
|
|
/* Functions from sig.c. */
|
|
|
|
extern sighandler termsig_sighandler __P((int));
|