I have my code running on the Mac and I am getting a 255 return code from exec.
The following is the code:
ret = execvp(pArgs[0], pArgs);
if (ret < 0)
{
ret = errno;
exit(ret);
return false;
}
else if (processId < 0)
{
// fork() failed
return false;
}
else if(Wait)
{
// forked successfuly so wait for exit
if(waitpid(processId, &childstatus, 0) == processId)
{
// codesign command terminted, get return code
if(WIFEXITED(childstatus))
{
if(pCmdRetStatus != NULL)
*pCmdRetStatus = WEXITSTATUS(childstatus);
}
}
}
Any thoughts on why the 255? Essentially an hdiutil call, a lot of times, I get 255.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…