diff options
author | hunt <hunt> | 2007-12-11 18:15:44 +0000 |
---|---|---|
committer | hunt <hunt> | 2007-12-11 18:15:44 +0000 |
commit | 0dade809a3197b89f407e294dd2ce2b037f18658 (patch) | |
tree | 6c6ce7dc9a21deae1e3784e1eebba84ae66e3b4c /runtime/staprun/relay.c | |
parent | b2199bb3837e6b3aacb7ad25d7ed4dca15dd41f7 (diff) | |
download | systemtap-steved-0dade809a3197b89f407e294dd2ce2b037f18658.tar.gz systemtap-steved-0dade809a3197b89f407e294dd2ce2b037f18658.tar.xz systemtap-steved-0dade809a3197b89f407e294dd2ce2b037f18658.zip |
2007-12-11 Martin Hunt <hunt@redhat.com>
PR5368
* relay_old.c (init_oldrelayfs): Don't start threads
if load_only.
* relay.c (init_relayfs): Ditto.
Diffstat (limited to 'runtime/staprun/relay.c')
-rw-r--r-- | runtime/staprun/relay.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/runtime/staprun/relay.c b/runtime/staprun/relay.c index 538d027c..19621933 100644 --- a/runtime/staprun/relay.c +++ b/runtime/staprun/relay.c @@ -97,7 +97,6 @@ static void *reader_thread(void *data) _perr("poll error"); return(NULL); } - stop_threads = 1; } while ((rc = read(relay_fd[cpu], buf, sizeof(buf))) > 0) { if (write(out_fd[cpu], buf, rc) != rc) { @@ -201,15 +200,17 @@ int init_relayfs(void) out_fd[0] = STDOUT_FILENO; } - dbug(2, "starting threads\n"); - for (i = 0; i < ncpus; i++) { - if (pthread_create(&reader[i], NULL, reader_thread, - (void *)(long)i) < 0) { - _perr("failed to create thread"); - return -1; + if (!load_only) { + dbug(2, "starting threads\n"); + for (i = 0; i < ncpus; i++) { + if (pthread_create(&reader[i], NULL, reader_thread, + (void *)(long)i) < 0) { + _perr("failed to create thread"); + return -1; + } } - } - + } + return 0; } |