diff options
author | Fabrice Le Fessant <fabrice.le_fessant@ocamlpro.com> | 2022-10-18 11:23:15 +0200 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2022-12-20 08:00:00 +0000 |
commit | 289c91e58e4603bd25a4e61111b0b40bebb993c1 (patch) | |
tree | 455c5d90b9d772ca7b208ce27ab730c19e406424 /src | |
parent | 97e0315b35d5b1f4c22e1714096f3f6fe308c3f0 (diff) | |
download | strace-289c91e58e4603bd25a4e61111b0b40bebb993c1.tar.gz |
src: rename tprintf to tprintf_string
Co-authored-by: Dmitry V. Levin <ldv@strace.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/defs.h | 2 | ||||
-rw-r--r-- | src/kd_ioctl.c | 4 | ||||
-rw-r--r-- | src/mmsghdr.c | 4 | ||||
-rw-r--r-- | src/nlattr.c | 2 | ||||
-rw-r--r-- | src/print_fields.h | 2 | ||||
-rw-r--r-- | src/print_instruction_pointer.c | 6 | ||||
-rw-r--r-- | src/print_syscall_number.c | 2 | ||||
-rw-r--r-- | src/printmode.c | 2 | ||||
-rw-r--r-- | src/s390.c | 8 | ||||
-rw-r--r-- | src/signal.c | 2 | ||||
-rw-r--r-- | src/sockaddr.c | 2 | ||||
-rw-r--r-- | src/strace.c | 43 | ||||
-rw-r--r-- | src/syscall.c | 42 | ||||
-rw-r--r-- | src/unwind.c | 14 | ||||
-rw-r--r-- | src/util.c | 33 | ||||
-rw-r--r-- | src/wait.c | 16 |
16 files changed, 93 insertions, 91 deletions
diff --git a/src/defs.h b/src/defs.h index b5c5d0968..397237598 100644 --- a/src/defs.h +++ b/src/defs.h @@ -1685,7 +1685,7 @@ extern struct tcb *printing_tcp; extern void printleader(struct tcb *); extern void line_ended(void); extern void tabto(void); -extern void tprintf(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2)); +extern void tprintf_string(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2)); extern void tprints_string(const char *str); extern void tprintf_comment(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2)); extern void tprints_comment(const char *str); diff --git a/src/kd_ioctl.c b/src/kd_ioctl.c index 44b3ddd0c..ada23d536 100644 --- a/src/kd_ioctl.c +++ b/src/kd_ioctl.c @@ -262,8 +262,8 @@ print_scrmap_array_member(struct tcb *tcp, void *elem_buf, if ((val & ~UNI_DIRECT_MASK) == UNI_DIRECT_BASE) (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE - ? tprintf_comment : tprintf)("UNI_DIRECT_BASE+%#hx", - val & UNI_DIRECT_MASK); + ? tprintf_comment : tprintf_string)("UNI_DIRECT_BASE+%#hx", + val & UNI_DIRECT_MASK); return true; } diff --git a/src/mmsghdr.c b/src/mmsghdr.c index c4babc912..6e2c8cc96 100644 --- a/src/mmsghdr.c +++ b/src/mmsghdr.c @@ -138,8 +138,8 @@ dumpiov_in_mmsghdr(struct tcb *const tcp, kernel_ulong_t addr) fetched = fetch_struct_mmsghdr(tcp, addr, &mmsg); if (!fetched) break; - tprintf(" = %" PRI_klu " buffers in vector %u\n", - (kernel_ulong_t) mmsg.msg_hdr.msg_iovlen, i); + tprintf_string(" = %" PRI_klu " buffers in vector %u\n", + (kernel_ulong_t) mmsg.msg_hdr.msg_iovlen, i); dumpiov_upto(tcp, mmsg.msg_hdr.msg_iovlen, ptr_to_kulong(mmsg.msg_hdr.msg_iov), mmsg.msg_len); diff --git a/src/nlattr.c b/src/nlattr.c index a9db9576b..1fb394d7c 100644 --- a/src/nlattr.c +++ b/src/nlattr.c @@ -511,7 +511,7 @@ decode_nla_ ## name(struct tcb *const tcp, \ if (len < sizeof(num)) \ return false; \ if (!umove_or_printaddr(tcp, addr, &num)) \ - tprintf(fmt, num); \ + tprintf_string(fmt, num); \ return true; \ } diff --git a/src/print_fields.h b/src/print_fields.h index 4e7b6cc28..4d4a9db70 100644 --- a/src/print_fields.h +++ b/src/print_fields.h @@ -19,7 +19,7 @@ * The printf-like function to use in header files * shared between strace and its tests. */ -# define STRACE_PRINTF tprintf +# define STRACE_PRINTF tprintf_string # else /* !IN_STRACE */ diff --git a/src/print_instruction_pointer.c b/src/print_instruction_pointer.c index b818544de..d2cc7628b 100644 --- a/src/print_instruction_pointer.c +++ b/src/print_instruction_pointer.c @@ -14,9 +14,9 @@ print_instruction_pointer(struct tcb *tcp) tprint_attribute_begin(); if (get_instruction_pointer(tcp, &ip)) { - tprintf(current_wordsize == 4 - ? "%08" PRI_klx - : "%016" PRI_klx, ip); + tprintf_string(current_wordsize == 4 + ? "%08" PRI_klx + : "%016" PRI_klx, ip); } else { tprints_string(current_wordsize == 4 ? "????????" diff --git a/src/print_syscall_number.c b/src/print_syscall_number.c index bcca7b502..82a1eaa66 100644 --- a/src/print_syscall_number.c +++ b/src/print_syscall_number.c @@ -12,7 +12,7 @@ print_syscall_number(struct tcb *tcp) { tprint_attribute_begin(); if (tcp->true_scno != (kernel_ulong_t) -1) - tprintf("%4" PRI_klu, tcp->true_scno); + tprintf_string("%4" PRI_klu, tcp->true_scno); else tprint_unavailable(); tprint_attribute_end(); diff --git a/src/printmode.c b/src/printmode.c index b509411a5..4328f048d 100644 --- a/src/printmode.c +++ b/src/printmode.c @@ -32,7 +32,7 @@ print_symbolic_mode_t(const unsigned int mode) return; (xlat_verbose(xlat_verbosity) == XLAT_STYLE_ABBREV - ? tprintf : tprintf_comment)("%s%s%s%s%s%#03o", + ? tprintf_string : tprintf_comment)("%s%s%s%s%s%#03o", ifmt, ifmt[0] ? "|" : "", (mode & S_ISUID) ? "S_ISUID|" : "", (mode & S_ISGID) ? "S_ISGID|" : "", diff --git a/src/s390.c b/src/s390.c index b36b94878..ca71730c4 100644 --- a/src/s390.c +++ b/src/s390.c @@ -791,7 +791,7 @@ print_funcs(const uint8_t funcs[8]) tprint_comment_begin(); cont = true; } - tprintf("%u: %s", i, func_descs[i]); + tprintf_string("%u: %s", i, func_descs[i]); } if (cont) @@ -806,7 +806,7 @@ print_sthyi_hypervisor(struct tcb *tcp, struct sthyi_hypervisor *hdr, CHECK_SIZE_EX(hdr, last_decoded, size, "hypervisor %d structure", num); - tprintf("/* hypervisor %d */ ", num); + tprintf_string("/* hypervisor %d */ ", num); tprint_struct_begin(); PRINT_FIELD_0X(*hdr, infyflg1); if (!abbrev(tcp) && hdr->infyflg1) @@ -922,7 +922,7 @@ print_sthyi_guest(struct tcb *tcp, struct sthyi_guest *hdr, uint16_t size, { CHECK_SIZE(hdr, size, "guest %d structure", num); - tprintf("/* guest %d */ ", num); + tprintf_string("/* guest %d */ ", num); tprint_struct_begin(); PRINT_FIELD_0X(*hdr, infgflg1); if (!abbrev(tcp) && hdr->infgflg1) @@ -1349,7 +1349,7 @@ guard_storage_print_gsepl(struct tcb *tcp, uint64_t addr) /* Since it is 64-bit even on 31-bit s390... */ if (sizeof(addr) > current_klongsize && addr >= (1ULL << (current_klongsize * 8))) { - tprintf("%#" PRIx64, addr); + tprintf_string("%#" PRIx64, addr); return; } diff --git a/src/signal.c b/src/signal.c index 56e8cb452..df4246000 100644 --- a/src/signal.c +++ b/src/signal.c @@ -810,7 +810,7 @@ SYS_FUNC(rt_sigtimedwait_time64) SYS_FUNC(restart_syscall) { - tprintf("<... resuming interrupted %s ...>", + tprintf_string("<... resuming interrupted %s ...>", tcp->s_prev_ent ? tcp->s_prev_ent->sys_name : "system call"); return RVAL_DECODED; diff --git a/src/sockaddr.c b/src/sockaddr.c index 794217cbd..ee1ce8828 100644 --- a/src/sockaddr.c +++ b/src/sockaddr.c @@ -181,7 +181,7 @@ print_inet_addr(const int af, if (var_name && (xlat_verbose(xlat_verbosity) == XLAT_STYLE_ABBREV)) { tprint_arg_next(); - tprintf("&%s", var_name); + tprintf_string("&%s", var_name); } tprint_arg_end(); diff --git a/src/strace.c b/src/strace.c index 897189f87..d2cae2caa 100644 --- a/src/strace.c +++ b/src/strace.c @@ -574,8 +574,8 @@ ptrace_restart(const unsigned int op, struct tcb *const tcp, unsigned int sig) */ if (current_tcp && current_tcp->curcol != 0) { tprint_space(); - tprintf("<Cannot restart pid %d with ptrace(%s): %s>", - tcp->pid, ptrace_op_str(op), strerror(err)); + tprintf_string("<Cannot restart pid %d with ptrace(%s): %s>", + tcp->pid, ptrace_op_str(op), strerror(err)); tprint_newline(); line_ended(); } @@ -714,7 +714,7 @@ tvprintf(const char *const fmt, va_list args) } void -tprintf(const char *fmt, ...) +tprintf_string(const char *fmt, ...) { va_list args; va_start(args, fmt); @@ -744,7 +744,7 @@ void tprints_comment(const char *const str) { if (str && *str) - tprintf(" /* %s */", str); + tprintf_string(" /* %s */", str); } void @@ -838,12 +838,12 @@ printleader(struct tcb *tcp) if (print_pid_pfx) { if (len) - tprintf("%u", tcp->pid); + tprintf_string("%u", tcp->pid); else - tprintf("%-5u", tcp->pid); + tprintf_string("%-5u", tcp->pid); } else { tprint_attribute_begin(); - tprintf("pid %5u", tcp->pid); + tprintf_string("pid %5u", tcp->pid); } print_comm_str(tcp->comm, len); @@ -868,10 +868,10 @@ printleader(struct tcb *tcp) else xsprintf(str, "%lld", (long long) local); if (tflag_width) - tprintf("%s.%0*ld ", str, tflag_width, - (long) ts.tv_nsec / tflag_scale); + tprintf_string("%s.%0*ld ", str, tflag_width, + (long) ts.tv_nsec / tflag_scale); else - tprintf("%s ", str); + tprintf_string("%s ", str); } if (rflag) { @@ -886,10 +886,11 @@ printleader(struct tcb *tcp) ts_sub(&dts, &ts, &ots); ots = ts; - tprintf("%s%6ld", tflag_format ? "(+" : "", (long) dts.tv_sec); + tprintf_string("%s%6ld", + tflag_format ? "(+" : "", (long) dts.tv_sec); if (rflag_width) { - tprintf(".%0*ld", - rflag_width, (long) dts.tv_nsec / rflag_scale); + tprintf_string(".%0*ld", rflag_width, + (long) dts.tv_nsec / rflag_scale); } tprints_string(tflag_format ? ") " : " "); } @@ -3142,8 +3143,8 @@ maybe_switch_tcbs(struct tcb *tcp, const int pid) if (cflag != CFLAG_ONLY_STATS) { if (!is_number_in_set(QUIET_THREAD_EXECVE, quiet_set)) { printleader(tcp); - tprintf("+++ superseded by execve in pid %lu +++", - old_pid); + tprintf_string("+++ superseded by execve in pid %lu +++", + old_pid); tprint_newline(); line_ended(); } @@ -3181,9 +3182,9 @@ print_signalled(struct tcb *tcp, const int pid, int status) if (cflag != CFLAG_ONLY_STATS && is_number_in_set(WTERMSIG(status), signal_set)) { printleader(tcp); - tprintf("+++ killed by %s %s+++", - sprintsigname(WTERMSIG(status)), - WCOREDUMP(status) ? "(core dumped) " : ""); + tprintf_string("+++ killed by %s %s+++", + sprintsigname(WTERMSIG(status)), + WCOREDUMP(status) ? "(core dumped) " : ""); tprint_newline(); line_ended(); } @@ -3200,7 +3201,7 @@ print_exited(struct tcb *tcp, const int pid, int status) if (cflag != CFLAG_ONLY_STATS && !is_number_in_set(QUIET_EXIT, quiet_set)) { printleader(tcp); - tprintf("+++ exited with %d +++", WEXITSTATUS(status)); + tprintf_string("+++ exited with %d +++", WEXITSTATUS(status)); tprint_newline(); line_ended(); } @@ -3214,11 +3215,11 @@ print_stopped(struct tcb *tcp, const siginfo_t *si, const unsigned int sig) && is_number_in_set(sig, signal_set)) { printleader(tcp); if (si) { - tprintf("--- %s ", sprintsigname(sig)); + tprintf_string("--- %s ", sprintsigname(sig)); printsiginfo(tcp, si); tprints_string(" ---"); } else - tprintf("--- stopped by %s ---", sprintsigname(sig)); + tprintf_string("--- stopped by %s ---", sprintsigname(sig)); tprint_newline(); line_ended(); diff --git a/src/syscall.c b/src/syscall.c index 3d195a20a..af03a649a 100644 --- a/src/syscall.c +++ b/src/syscall.c @@ -255,8 +255,8 @@ update_personality(struct tcb *tcp, unsigned int personality) if (!is_number_in_set(QUIET_PERSONALITY, quiet_set)) { printleader(tcp); - tprintf("[ Process PID=%d runs in %s mode. ]\n", - tcp->pid, personality_names[personality]); + tprintf_string("[ Process PID=%d runs in %s mode. ]\n", + tcp->pid, personality_names[personality]); line_ended(); } @@ -421,12 +421,12 @@ print_err(int64_t err, bool negated) const char *str = err_name(negated ? -err : err); if (!str || xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) - tprintf(negated ? "%" PRId64 : "%" PRIu64, err); + tprintf_string(negated ? "%" PRId64 : "%" PRIu64, err); if (!str || xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) return; (xlat_verbose(xlat_verbosity) == XLAT_STYLE_ABBREV - ? tprintf : tprintf_comment)("%s%s", - negated ? "-" : "", str); + ? tprintf_string : tprintf_comment)("%s%s", + negated ? "-" : "", str); } static void @@ -435,10 +435,10 @@ print_err_ret(kernel_ulong_t ret, unsigned long u_error) const char *u_error_str = err_name(u_error); if (u_error_str) - tprintf("= %" PRI_kld " %s (%s)", - ret, u_error_str, strerror(u_error)); + tprintf_string("= %" PRI_kld " %s (%s)", + ret, u_error_str, strerror(u_error)); else - tprintf("= %" PRI_kld " (errno %lu)", ret, u_error); + tprintf_string("= %" PRI_kld " (errno %lu)", ret, u_error); } static long get_regs(struct tcb *); @@ -753,7 +753,7 @@ print_syscall_resume(struct tcb *tcp) || (tcp->flags & TCB_REPRINT)) { tcp->flags &= ~TCB_REPRINT; printleader(tcp); - tprintf("<... %s resumed>", tcp_sysent(tcp)->sys_name); + tprintf_string("<... %s resumed>", tcp_sysent(tcp)->sys_name); } } @@ -836,7 +836,7 @@ syscall_exiting_trace(struct tcb *tcp, struct timespec *ts, int res) if (tcp->u_error) print_err_ret(tcp->u_rval, tcp->u_error); else - tprintf("= %#" PRI_klx, tcp->u_rval); + tprintf_string("= %#" PRI_klx, tcp->u_rval); print_injected_note(tcp); } else if (!(sys_res & RVAL_NONE) && tcp->u_error) { @@ -900,7 +900,7 @@ syscall_exiting_trace(struct tcb *tcp, struct timespec *ts, int res) } print_injected_note(tcp); if ((sys_res & RVAL_STR) && tcp->auxstr) - tprintf(" (%s)", tcp->auxstr); + tprintf_string(" (%s)", tcp->auxstr); } else { if (sys_res & RVAL_NONE) tprints_string("= ?"); @@ -909,12 +909,12 @@ syscall_exiting_trace(struct tcb *tcp, struct timespec *ts, int res) case RVAL_HEX: #if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG if (current_klongsize < sizeof(tcp->u_rval)) { - tprintf("= %#x", - (unsigned int) tcp->u_rval); + tprintf_string("= %#x", + (unsigned int) tcp->u_rval); } else #endif { - tprintf("= %#" PRI_klx, tcp->u_rval); + tprintf_string("= %#" PRI_klx, tcp->u_rval); } break; case RVAL_OCTAL: { @@ -931,12 +931,12 @@ syscall_exiting_trace(struct tcb *tcp, struct timespec *ts, int res) case RVAL_UDECIMAL: #if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG if (current_klongsize < sizeof(tcp->u_rval)) { - tprintf("= %u", - (unsigned int) tcp->u_rval); + tprintf_string("= %u", + (unsigned int) tcp->u_rval); } else #endif { - tprintf("= %" PRI_klu, tcp->u_rval); + tprintf_string("= %" PRI_klu, tcp->u_rval); } break; case RVAL_FD: @@ -949,7 +949,7 @@ syscall_exiting_trace(struct tcb *tcp, struct timespec *ts, int res) tprints_string("= "); printfd(tcp, tcp->u_rval); } else { - tprintf("= %" PRI_kld, tcp->u_rval); + tprintf_string("= %" PRI_kld, tcp->u_rval); } break; case RVAL_TID: @@ -973,7 +973,7 @@ syscall_exiting_trace(struct tcb *tcp, struct timespec *ts, int res) } } if ((sys_res & RVAL_STR) && tcp->auxstr) - tprintf(" (%s)", tcp->auxstr); + tprintf_string(" (%s)", tcp->auxstr); print_injected_note(tcp); } if (Tflag) { @@ -982,8 +982,8 @@ syscall_exiting_trace(struct tcb *tcp, struct timespec *ts, int res) ts_sub(ts, ts, &tcp->etime); PRINT_VAL_D(ts->tv_sec); if (Tflag_width) { - tprintf(".%0*ld", - Tflag_width, (long) ts->tv_nsec / Tflag_scale); + tprintf_string(".%0*ld", Tflag_width, + (long) ts->tv_nsec / Tflag_scale); } tprint_associated_info_end(); } diff --git a/src/unwind.c b/src/unwind.c index 6e458d522..8aa1b549c 100644 --- a/src/unwind.c +++ b/src/unwind.c @@ -111,19 +111,19 @@ print_call_cb(void *dummy, cplus_demangle(symbol_name, DMGL_AUTO | DMGL_PARAMS); #endif - tprintf(STACK_ENTRY_SYMBOL_FMT( + tprintf_string(STACK_ENTRY_SYMBOL_FMT( #ifdef USE_DEMANGLE - demangled_name ? demangled_name : + demangled_name ? demangled_name : #endif - symbol_name)); + symbol_name)); #ifdef USE_DEMANGLE free(demangled_name); #endif } else if (binary_filename) - tprintf(STACK_ENTRY_NOSYMBOL_FMT); + tprintf_string(STACK_ENTRY_NOSYMBOL_FMT); else - tprintf(STACK_ENTRY_BUG_FMT, __func__); + tprintf_string(STACK_ENTRY_BUG_FMT, __func__); line_ended(); } @@ -134,9 +134,9 @@ print_error_cb(void *dummy, unsigned long true_offset) { if (true_offset) - tprintf(STACK_ENTRY_ERROR_WITH_OFFSET_FMT); + tprintf_string(STACK_ENTRY_ERROR_WITH_OFFSET_FMT); else - tprintf(STACK_ENTRY_ERROR_FMT); + tprintf_string(STACK_ENTRY_ERROR_FMT); line_ended(); } diff --git a/src/util.c b/src/util.c index 14f4f92ad..9487e8f6f 100644 --- a/src/util.c +++ b/src/util.c @@ -416,7 +416,7 @@ printnum_ ## name(struct tcb *const tcp, const kernel_ulong_t addr, \ if (umove_or_printaddr(tcp, addr, &num)) \ return false; \ tprint_indirect_begin(); \ - tprintf(fmt, num); \ + tprintf_string(fmt, num); \ tprint_indirect_end(); \ return true; \ } @@ -443,9 +443,9 @@ printpair_ ## name(struct tcb *const tcp, const kernel_ulong_t addr, \ if (umove_or_printaddr(tcp, addr, &pair)) \ return false; \ tprint_array_begin(); \ - tprintf(fmt, pair[0]); \ + tprintf_string(fmt, pair[0]); \ tprint_array_next(); \ - tprintf(fmt, pair[1]); \ + tprintf_string(fmt, pair[1]); \ tprint_array_end(); \ return true; \ } @@ -668,9 +668,9 @@ printdev(struct tcb *tcp, int fd, const char *path) QUOTE_OMIT_LEADING_TRAILING_QUOTES, "<>"); tprint_associated_info_begin(); - tprintf("%s %u:%u", - S_ISBLK(st.st_mode)? "block" : "char", - major(st.st_rdev), minor(st.st_rdev)); + tprintf_string("%s %u:%u", + S_ISBLK(st.st_mode)? "block" : "char", + major(st.st_rdev), minor(st.st_rdev)); tprint_associated_info_end(); tprint_associated_info_end(); return true; @@ -1259,7 +1259,7 @@ print_nonzero_bytes(struct tcb *const tcp, ret = false; } else { prefix_fun(); - tprintf("/* bytes %u..%u */ ", start_offs, total_len - 1); + tprintf_string("/* bytes %u..%u */ ", start_offs, total_len - 1); print_quoted_string(str, size, style); @@ -1317,7 +1317,8 @@ dumpiov_upto(struct tcb *const tcp, const int len, const kernel_ulong_t addr, data_size -= iov_len; /* include the buffer number to make it easy to * match up the trace with the source */ - tprintf(" * %" PRI_klu " bytes in buffer %d\n", iov_len, i); + tprintf_string(" * %" PRI_klu " bytes in buffer %d\n", + iov_len, i); dumpstr(tcp, iov_iov_base(i), iov_len); } } @@ -1416,12 +1417,12 @@ dumpstr(struct tcb *const tcp, const kernel_ulong_t addr, * something already. */ if (i) - tprintf(" | <Cannot fetch %" PRI_klu - " byte%s from pid %d" - " @%#" PRI_klx ">\n", - fetch_size, - fetch_size == 1 ? "" : "s", - tcp->pid, addr + i); + tprintf_string(" | <Cannot fetch %" PRI_klu + " byte%s from pid %d" + " @%#" PRI_klx ">\n", + fetch_size, + fetch_size == 1 ? "" : "s", + tcp->pid, addr + i); return; } src = str; @@ -1457,8 +1458,8 @@ dumpstr(struct tcb *const tcp, const kernel_ulong_t addr, src++; } while (++i & DUMPSTR_BYTES_MASK); - tprintf(" | %0*" PRI_klx " %s |\n", - offs_chars, i - DUMPSTR_WIDTH_BYTES, outbuf); + tprintf_string(" | %0*" PRI_klx " %s |\n", + offs_chars, i - DUMPSTR_WIDTH_BYTES, outbuf); } } diff --git a/src/wait.c b/src/wait.c index 69460faa8..1f04e836e 100644 --- a/src/wait.c +++ b/src/wait.c @@ -35,18 +35,18 @@ printstatus(int status) tprint_flags_begin(); if (WIFSTOPPED(status)) { int sig = WSTOPSIG(status); - tprintf("{WIFSTOPPED(s) && WSTOPSIG(s) == %s%s}", - sprintsigname(sig & 0x7f), - sig & 0x80 ? " | 0x80" : ""); + tprintf_string("{WIFSTOPPED(s) && WSTOPSIG(s) == %s%s}", + sprintsigname(sig & 0x7f), + sig & 0x80 ? " | 0x80" : ""); status &= ~W_STOPCODE(sig); } else if (WIFSIGNALED(status)) { - tprintf("{WIFSIGNALED(s) && WTERMSIG(s) == %s%s}", - sprintsigname(WTERMSIG(status)), - WCOREDUMP(status) ? " && WCOREDUMP(s)" : ""); + tprintf_string("{WIFSIGNALED(s) && WTERMSIG(s) == %s%s}", + sprintsigname(WTERMSIG(status)), + WCOREDUMP(status) ? " && WCOREDUMP(s)" : ""); status &= ~(W_EXITCODE(0, WTERMSIG(status)) | WCOREFLAG); } else if (WIFEXITED(status)) { - tprintf("{WIFEXITED(s) && WEXITSTATUS(s) == %d}", - WEXITSTATUS(status)); + tprintf_string("{WIFEXITED(s) && WEXITSTATUS(s) == %d}", + WEXITSTATUS(status)); exited = 1; status &= ~W_EXITCODE(WEXITSTATUS(status), 0); } |