+2009-04-20 Denys Vlasenko <dvlasenk@redhat.com>
+
+ * strace.c (collect_stopped_tcbs): Do not enable/disable signals
+ multiple times, do it just once per collecting pass.
+
2009-04-16 Denys Vlasenko <dvlasenk@redhat.com>
* file.c (print_dirfd): Use int for file descriptor, not a long.
nextp = &found_tcps;
#endif /* LINUX */
+ /* Make it possible to ^C strace while we wait */
+ if (interactive)
+ sigprocmask(SIG_SETMASK, &empty_set, NULL);
+
found_tcps = NULL;
while (1) {
if (interrupted)
break;
- if (interactive)
- sigprocmask(SIG_SETMASK, &empty_set, NULL);
#ifdef LINUX
#ifdef __WALL
pid = wait4(-1, &status, wait4_options | wnohang, ru_ptr);
pid = wait(&status);
#endif /* SUNOS4 */
wait_errno = errno;
- if (interactive)
- sigprocmask(SIG_BLOCK, &blocked_set, NULL);
if (pid == 0 && wnohang) {
/* We had at least one successful
if (f == tcp) {
remembered_pid = pid;
remembered_status = status;
- return found_tcps;
+ goto ret;
}
f = f->next_need_service;
}
break;
#endif
} /* while (1) - collecting all stopped/exited tracees */
+ ret:
+ /* Disable ^C etc */
+ if (interactive)
+ sigprocmask(SIG_BLOCK, &blocked_set, NULL);
return found_tcps;
}