From: John L. <mov...@us...> - 2003-06-02 22:59:10
|
Update of /cvsroot/oprofile/oprofile/libutil++ In directory sc8-pr-cvs1:/tmp/cvs-serv7994/libutil++ Modified Files: child_reader.cpp Log Message: remove some unused abi code Index: child_reader.cpp =================================================================== RCS file: /cvsroot/oprofile/oprofile/libutil++/child_reader.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -p -d -r1.11 -r1.12 --- child_reader.cpp 19 Oct 2002 00:36:54 -0000 1.11 +++ child_reader.cpp 2 Jun 2003 22:59:05 -0000 1.12 @@ -23,16 +23,12 @@ using namespace std; child_reader::child_reader(string const & cmd, vector<string> const & args) : - fd1(-1), - fd2(-1), - pos1(0), - end1(0), - pos2(0), - end2(0), + fd1(-1), fd2(-1), + pos1(0), end1(0), + pos2(0), end2(0), pid(0), first_error(0), - buf2(0), - sz_buf2(0), + buf2(0), sz_buf2(0), buf1(new char [PIPE_BUF]), process_name(cmd), is_terminated(true), @@ -42,6 +38,7 @@ child_reader::child_reader(string const exec_command(cmd, args); } + child_reader::~child_reader() { terminate_process(); @@ -52,6 +49,7 @@ child_reader::~child_reader() } } + void child_reader::exec_command(string const & cmd, vector<string> const & args) { int pstdout[2]; @@ -117,6 +115,7 @@ void child_reader::exec_command(string c return; } + bool child_reader::block_read() { fd_set read_fs; @@ -156,6 +155,7 @@ bool child_reader::block_read() return ret; } + bool child_reader::getline(string & result) { // some stl lacks string::clear() @@ -198,6 +198,7 @@ bool child_reader::getline(string & resu return end1 != 0 || result.length() != 0; } + bool child_reader::get_data(ostream & out, ostream & err) { bool ret = true; @@ -213,9 +214,11 @@ bool child_reader::get_data(ostream & ou return first_error == 0; } -// can be called explicitely or by dtor, we must protect against multiple call + int child_reader::terminate_process() { + // can be called explicitely or by dtor, + // we must protect against multiple call if (!is_terminated) { int ret; waitpid(pid, &ret, 0); @@ -246,6 +249,7 @@ int child_reader::terminate_process() return first_error; } + string child_reader::error_str() const { |