diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2007-10-10 13:58:43 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2007-10-10 13:58:43 -0400 |
commit | 36c24cdba10c3d20638c78b52cc8e327a3a0b82d (patch) | |
tree | 24cbeb006365fdaa21dbf9cf3b44eae055684123 /runtime/staprun/relay_old.c | |
parent | 38d7fc30b108ec4a9e74ddb33d945cce1bd5c4c6 (diff) | |
parent | d319669c3f77a3e451f1cad845471433e6d0dbfa (diff) | |
download | systemtap-steved-36c24cdba10c3d20638c78b52cc8e327a3a0b82d.tar.gz systemtap-steved-36c24cdba10c3d20638c78b52cc8e327a3a0b82d.tar.xz systemtap-steved-36c24cdba10c3d20638c78b52cc8e327a3a0b82d.zip |
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Diffstat (limited to 'runtime/staprun/relay_old.c')
-rw-r--r-- | runtime/staprun/relay_old.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/runtime/staprun/relay_old.c b/runtime/staprun/relay_old.c index 3f65acbb..f138aee5 100644 --- a/runtime/staprun/relay_old.c +++ b/runtime/staprun/relay_old.c @@ -86,7 +86,7 @@ static int open_relayfs_files(int cpu, const char *relay_filebase, const char *p return -1; dbug(2, "Opening %s.\n", tmp); relay_fd[cpu] = open(tmp, O_RDONLY | O_NONBLOCK); - if (relay_fd[cpu] < 0) { + if (relay_fd[cpu] < 0 || set_clexec(relay_fd[cpu]) < 0) { relay_fd[cpu] = 0; return 0; } @@ -99,6 +99,10 @@ static int open_relayfs_files(int cpu, const char *relay_filebase, const char *p perr("Couldn't open proc file %s", tmp); goto err1; } + if (set_clexec(relay_fd[cpu]) < 0) { + relay_fd[cpu] = 0; + return -1; + } if (outfile_name) { /* special case: for testing we sometimes want to @@ -118,6 +122,10 @@ static int open_relayfs_files(int cpu, const char *relay_filebase, const char *p perr("Couldn't open output file %s", tmp); goto err2; } + if (set_clexec(fileno(percpu_tmpfile[cpu])) < 0) { + perr("Couldn't open output file %s", tmp); + goto err2; + } total_bufsize = subbuf_size * n_subbufs; relay_buffer[cpu] = mmap(NULL, total_bufsize, PROT_READ, @@ -243,7 +251,7 @@ int init_oldrelayfs(void) if (!bulkmode) { if (outfile_name) { out_fd[0] = open (outfile_name, O_CREAT|O_TRUNC|O_WRONLY, 0666); - if (out_fd[0] < 0) { + if (out_fd[0] < 0 || set_clexec(out_fd[0]) < 0) { perr("Couldn't open output file '%s'", outfile_name); return -1; } |