summaryrefslogtreecommitdiffstats
path: root/runtime/staprun/relay.c
diff options
context:
space:
mode:
authorhunt <hunt>2007-10-09 16:03:04 +0000
committerhunt <hunt>2007-10-09 16:03:04 +0000
commit577e7ed19be74db082ba058016fd31b643495ebd (patch)
treec395a0e02f95de53044400fba71000c9e8f5bc3b /runtime/staprun/relay.c
parenta6053c5b3f42ef0e016df9074ebc75c93a79d544 (diff)
downloadsystemtap-steved-577e7ed19be74db082ba058016fd31b643495ebd.tar.gz
systemtap-steved-577e7ed19be74db082ba058016fd31b643495ebd.tar.xz
systemtap-steved-577e7ed19be74db082ba058016fd31b643495ebd.zip
2007-10-09 Martin Hunt <hunt@redhat.com>
* common.c (set_clexec): New. * staprun.h: Add prototype for set_clexec. * relay*.c, ctl.c: Call set_clexec after file opens.
Diffstat (limited to 'runtime/staprun/relay.c')
-rw-r--r--runtime/staprun/relay.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/staprun/relay.c b/runtime/staprun/relay.c
index 30c4ce1e..538d027c 100644
--- a/runtime/staprun/relay.c
+++ b/runtime/staprun/relay.c
@@ -148,7 +148,7 @@ int init_relayfs(void)
return -1;
dbug(2, "attempting to open %s\n", buf);
relay_fd[i] = open(buf, O_RDONLY | O_NONBLOCK);
- if (relay_fd[i] < 0)
+ if (relay_fd[i] < 0 || set_clexec(relay_fd[i]) < 0)
break;
}
ncpus = i;
@@ -184,6 +184,8 @@ int init_relayfs(void)
perr("Couldn't open output file %s", buf);
return -1;
}
+ if (set_clexec(out_fd[i]) < 0)
+ return -1;
}
} else {
/* stream mode */
@@ -193,6 +195,8 @@ int init_relayfs(void)
perr("Couldn't open output file %s", outfile_name);
return -1;
}
+ if (set_clexec(out_fd[i]) < 0)
+ return -1;
} else
out_fd[0] = STDOUT_FILENO;