#include"sprocess.h"

#include<unistd.h>

//----------------------------------------------------------------------------
// SProcess
//----------------------------------------------------------------------------
SProcess::SProcess()
:JProcess()
{
	setChildStartingHandler(childStarting);
}

SProcess::~SProcess()
{
}

void SProcess::setClosePipeList(const QValueList<int> &list)
{
	pipeList = list;
}

void SProcess::childStarting(JProcess *p)
{
	SProcess *that = (SProcess *)p;
	// close all pipes
	for(QValueList<int>::ConstIterator it = that->pipeList.begin(); it != that->pipeList.end(); ++it) {
		int x = *it;
		close(x);
	}
}
