summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--src/run.c9
2 files changed, 8 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 1ddb043..bfd0ba9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-05-30 Jiri Olsa <olsajiri@gmail.com>
+ * fixed bug in tracer waiting code
+ (do not exit the loop prematurely)
+
2011-05-25 Jiri Olsa <olsajiri@gmail.com>
* adding SIGTERM/SIGINT handlers,
refactoring lt_run to check the latrace got killed
diff --git a/src/run.c b/src/run.c
index 9a5fa43..7f48b53 100644
--- a/src/run.c
+++ b/src/run.c
@@ -155,7 +155,7 @@ static int process(struct lt_config_app *cfg, struct lt_process_args *pa)
fd_set cfg_set, wrk_set;
int fd_notify = pa->fd_notify;
int fd_tty_master = pa->fd_tty_master;
- int max_fd = 0, wait;
+ int max_fd = 0;
#define MAX(a,b) ((a) < (b) ? (b) : (a))
FD_ZERO(&cfg_set);
@@ -176,7 +176,7 @@ static int process(struct lt_config_app *cfg, struct lt_process_args *pa)
max_fd = MAX(fd_notify, fd_tty_master);
}
- while(((wait = waitpid(pa->pid, &status, WNOHANG)) == 0) ||
+ while((waitpid(pa->pid, &status, WNOHANG) == 0) ||
/* let all the thread fifo close */
(finish) ||
/* Get inside at least once, in case the traced program
@@ -197,9 +197,8 @@ if (ret < 0) \
struct lt_thread *t;
int ret;
- /* we either got a signal or we lost the child,
- * either way there's nothing to wait for.. */
- if (exit_flag || (wait == -1))
+ /* we got a signal, there's nothing to wait for.. */
+ if (exit_flag)
break;
getin = 0;