From: Dmitry V. Levin Date: Sun, 17 Mar 2019 14:36:56 +0000 (+0000) Subject: Change -D option to imply -I4 X-Git-Tag: v5.0~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4249fe48566e93c89282aa90fffc0fa11f9e4f61;p=strace Change -D option to imply -I4 * 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 --- diff --git a/NEWS b/NEWS index 61f1b04c..2afeae5a 100644 --- 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. diff --git a/strace.1.in b/strace.1.in index 160a923c..76a74119 100644 --- a/strace.1.in +++ b/strace.1.in @@ -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 diff --git a/strace.c b/strace.c index 0aa6d2be..922e8813 100644 --- 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;