--- projects/cms/source/host/c++/SubPipe.cpp 2001/03/06 00:41:30 1.1 +++ projects/cms/source/host/c++/SubPipe.cpp 2002/05/21 16:47:11 1.4 @@ -1,8 +1,28 @@ +/* + * i-scream central monitoring system + * http://www.i-scream.org.uk + * Copyright (C) 2000-2002 i-scream + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + #include "SubPipe.h" SubPipe::SubPipe(string command){ - p = new iopipestream("statgrab.pl"); + p = new iopipestream(command.c_str()); pid = (*p).pid(); } // subPipe @@ -27,6 +47,8 @@ SubPipe::~SubPipe(){ // wait for process to finish first waitpid(pid , 0, 0); + // remove all pointers to it, free up the memory so + // we can reclaim the file handles back delete p; } // ~SubPipe