summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorDavid Smith <dsmith@redhat.com>2010-04-05 10:55:57 -0500
committerDavid Smith <dsmith@redhat.com>2010-04-05 10:55:57 -0500
commite997043d5bc97969ccf26b171c23f2a5bbddfbd1 (patch)
tree4a4431bdecf3a054bd17c975d9889182508bbfc4 /runtime
parent8abeee5dd3a869f50e594ef4a4fb292a76000d82 (diff)
downloadsystemtap-steved-e997043d5bc97969ccf26b171c23f2a5bbddfbd1.tar.gz
systemtap-steved-e997043d5bc97969ccf26b171c23f2a5bbddfbd1.tar.xz
systemtap-steved-e997043d5bc97969ccf26b171c23f2a5bbddfbd1.zip
Fixed BZ 557165 by adding better error handling.
* runtime/staprun/mainloop.c (stp_main_loop): When a read error happens, quit instead of retrying (which can end up in an infinite loop).
Diffstat (limited to 'runtime')
-rw-r--r--runtime/staprun/mainloop.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/staprun/mainloop.c b/runtime/staprun/mainloop.c
index ab228937..7381e3c8 100644
--- a/runtime/staprun/mainloop.c
+++ b/runtime/staprun/mainloop.c
@@ -497,8 +497,10 @@ int stp_main_loop(void)
nb = read(control_channel, recvbuf, sizeof(recvbuf));
dbug(2, "nb=%d\n", (int)nb);
if (nb <= 0) {
- if (errno != EINTR)
+ if (errno != EINTR && errno != EAGAIN) {
_perr("Unexpected EOF in read (nb=%ld)", (long)nb);
+ cleanup_and_exit(0, 1);
+ }
continue;
}