summaryrefslogtreecommitdiffstats
path: root/grapher
diff options
context:
space:
mode:
authorTim Moore <timoore@redhat.com>2009-12-08 11:06:04 +0100
committerTim Moore <timoore@redhat.com>2009-12-08 11:06:04 +0100
commit72a9e5a2d3788f5465eb5e1610f2402744054f2e (patch)
tree31683dd0ab0e75963ce873f9ca61b3ab3b30f1c8 /grapher
parentf669d095ba7fe5a623b31abc05b4f6664059803b (diff)
downloadsystemtap-steved-72a9e5a2d3788f5465eb5e1610f2402744054f2e.tar.gz
systemtap-steved-72a9e5a2d3788f5465eb5e1610f2402744054f2e.tar.xz
systemtap-steved-72a9e5a2d3788f5465eb5e1610f2402744054f2e.zip
tiny refactoring of signal and pipe code
Diffstat (limited to 'grapher')
-rw-r--r--grapher/grapher.cxx17
1 files changed, 6 insertions, 11 deletions
diff --git a/grapher/grapher.cxx b/grapher/grapher.cxx
index 1e5e30b8..567b0405 100644
--- a/grapher/grapher.cxx
+++ b/grapher/grapher.cxx
@@ -227,19 +227,14 @@ int StapLauncher::launch()
&ChildDeathReader::ioCallback),
signalPipe[0], Glib::IO_IN);
}
+ struct sigaction action;
+ action.sa_sigaction = handleChild;
+ sigemptyset(&action.sa_mask);
+ action.sa_flags = SA_SIGINFO | SA_NOCLDSTOP;
+ sigaction(SIGCLD, &action, 0);
}
- struct sigaction action;
- action.sa_sigaction = handleChild;
- sigemptyset(&action.sa_mask);
- action.sa_flags = SA_SIGINFO | SA_NOCLDSTOP;
- sigaction(SIGCLD, &action, 0);
int pipefd[4];
- if (pipe(&pipefd[0]) < 0)
- {
- std::perror("pipe");
- exit(1);
- }
- if (pipe(&pipefd[2]) < 0)
+ if (pipe(&pipefd[0]) < 0 || pipe(&pipefd[2]) < 0)
{
std::perror("pipe");
exit(1);