From 6fb95a63ecfa32b1524790ee42695f19773f2174 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Tue, 20 Oct 2009 22:14:00 +0200 Subject: Change stap parser to use an input file descriptor other than stdin * grapher/StapParser.hxx (_inFd, getInFd, setInFd): new member and fuctions * grapher/StapParser.cxx (ioCallback): Use _inFd variable instead of stdin. * grapher/grapher.cxx (StapLauncher::launch): Don't read input from stap on stdin; use the the read end of the pipe. --- grapher/StapParser.hxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'grapher/StapParser.hxx') diff --git a/grapher/StapParser.hxx b/grapher/StapParser.hxx index f4f6bdef..eeebed63 100644 --- a/grapher/StapParser.hxx +++ b/grapher/StapParser.hxx @@ -13,14 +13,20 @@ class StapParser Gtk::Window& _win; GraphWidget& _widget; int _errFd; + int _inFd; public: StapParser(Gtk::Window& win, - GraphWidget& widget) : _win(win), _widget(widget), _errFd(-1) {} + GraphWidget& widget) : _win(win), _widget(widget), _errFd(-1), + _inFd(-1) + { + } void parseData(std::tr1::shared_ptr gdata, double time, const std::string& dataString); bool ioCallback(Glib::IOCondition ioCondition); bool errIoCallback(Glib::IOCondition ioCondition); int getErrFd() { return _errFd; } void setErrFd(int fd) { _errFd = fd; } + int getInFd() { return _inFd; } + void setInFd(int fd) { _inFd = fd; } }; } -- cgit