helpers.cpp: fix errorlevel of child-process; whitespace cleanup

Origin commit data
------------------
Commit: acaf807bbb
Author: vanhofen <vanhofen@gmx.de>
Date: 2012-09-15 (Sat, 15 Sep 2012)

Origin message was:
------------------
- helpers.cpp: fix errorlevel of child-process; whitespace cleanup
This commit is contained in:
vanhofen
2012-09-15 21:26:12 +02:00
parent 17fffd5a43
commit 481b69e4ca

View File

@@ -69,7 +69,7 @@ int my_system(const char * cmd)
int my_system(const char * cmd, const char * arg1, const char * arg2, const char * arg3, const char * arg4, const char * arg5, const char * arg6)
{
int i=0 ,ret=0;
int i=0 ,ret=0, childExit=0;
pid_t pid;
int maxfd = getdtablesize();// sysconf(_SC_OPEN_MAX);
switch (pid = vfork())
@@ -90,7 +90,9 @@ int my_system(const char * cmd, const char * arg1, const char * arg2, const char
default: /* parent returns to calling process */
break;
}
waitpid(pid, 0, 0);
waitpid(pid, &childExit, 0);
if(childExit != 0)
ret = childExit;
return ret;
}