]> granicus.if.org Git - strace/commitdiff
Change -D option to imply -I4
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 17 Mar 2019 14:36:56 +0000 (14:36 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 17 Mar 2019 14:36:56 +0000 (14:36 +0000)
* strace.c (init) [daemonized_tracer && !opt_intr]: Set opt_intr
to INTR_BLOCK_TSTP_TOO.
* strace.1.in: Document this.
* NEWS: Mention this change.

Resolves: https://github.com/strace/strace/issues/96

NEWS
strace.1.in
strace.c

diff --git a/NEWS b/NEWS
index 61f1b04c2c7b46d3e255e215254aa6d61866c8de..2afeae5aa5f6034332c5de503f7f245d612c038f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,11 @@
 Noteworthy changes in release ?.?? (????-??-??)
 ===============================================
 
+* Changes in behavior
+  * -D option now implies -I4: by default strace ignores SIGHUP, SIGINT,
+    SIGQUIT, SIGPIPE, SIGTERM, SIGTTIN, SIGTTOU, and SIGTSTP when -D option
+    is used.
+
 * Improvements
   * Enhanced xlat styles support configured by -X option.
   * Enhanced decoding of bpf syscall.
index 160a923c051c03e9d58f1f12190573d6e4cba687..76a74119268114b0012328d540cdbbe15eb66d2b 100644 (file)
@@ -844,7 +844,9 @@ fatal signals and
 are always blocked (useful to make
 .BI "strace -o " "FILE PROG"
 not stop on
-.BR CTRL\-Z ).
+.BR CTRL\-Z ,
+default if
+.BR \-D ).
 .RE
 .SS Startup
 .TP 12
index 0aa6d2beff58eb1f1677ec6181b853d5f1bff507..922e8813c03c84eb50895fa5a866d9a66dab270e 100644 (file)
--- a/strace.c
+++ b/strace.c
@@ -85,7 +85,7 @@ enum {
        INTR_ANYWHERE       = 1, /* don't block/ignore any signals */
        INTR_WHILE_WAIT     = 2, /* block fatal signals while decoding syscall. default */
        INTR_NEVER          = 3, /* block fatal signals. default if '-o FILE PROG' */
-       INTR_BLOCK_TSTP_TOO = 4, /* block fatal signals and SIGTSTP (^Z) */
+       INTR_BLOCK_TSTP_TOO = 4, /* block fatal signals and SIGTSTP (^Z); default if -D */
        NUM_INTR_OPTS
 };
 static int opt_intr;
@@ -1852,6 +1852,8 @@ init(int argc, char *argv[])
         * no           1       1       INTR_WHILE_WAIT
         */
 
+       if (daemonized_tracer && !opt_intr)
+               opt_intr = INTR_BLOCK_TSTP_TOO;
        if (outfname && argc) {
                if (!opt_intr)
                        opt_intr = INTR_NEVER;