-/* $Id$
-
-This file is part of builder
-Copyright © 2006-2009 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
#include <cstring>
#include <cstdlib>
#include <sys/wait.h>
IO::print("%s\n", join(argv.begin(), argv.end()));
if(builder.get_dry_run())
- pid=-1;
+ pid = -1;
else
{
- pid=fork();
+ pid = fork();
if(pid==0)
{
char *argv_[argv.size()+1];
- unsigned j=0;
+ unsigned j = 0;
for(StringList::iterator i=argv.begin(); i!=argv.end(); ++i)
- argv_[j++]=strdup(i->c_str());
- argv_[j]=0;
+ argv_[j++] = strdup(i->c_str());
+ argv_[j] = 0;
if(!work_dir.empty())
FS::chdir(work_dir);
exit(1);
}
else if(pid<0)
- pid=0;
+ pid = 0;
}
}
{
signal_done.emit();
if(WIFEXITED(status))
- exit_code=WEXITSTATUS(status);
+ exit_code = WEXITSTATUS(status);
else
- exit_code=254;
- pid=0;
+ exit_code = 254;
+ pid = 0;
return exit_code;
}
else