applied patches from openbsd-ports, closed #1105041 (sf)

execl needs a terminating NULL at the end, a '0' would be
    converted to "int 0" on 64bit-systems
This commit is contained in:
mathias 2005-01-20 12:30:35 +00:00
parent 52a8360e5b
commit 6fbe0e44d6
2 changed files with 3 additions and 3 deletions

View file

@ -131,11 +131,11 @@ void ExecuteCmd::execute() {
displaystring += intbuff;
setsid();
putenv(const_cast<char *>(displaystring.c_str()));
execl("/bin/sh", "/bin/sh", "-c", m_cmd.c_str(), 0);
execl("/bin/sh", "/bin/sh", "-c", m_cmd.c_str(), static_cast<void*>(NULL));
exit(0);
}
#else // __EMX__
spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", m_cmd.c_str(), 0);
spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", m_cmd.c_str(), static_cast<void*>(NULL));
#endif // !__EMX__
}

View file

@ -117,7 +117,7 @@ void FbRun::run(const std::string &command) {
// fork and execute program
if (!fork()) {
setsid();
execl("/bin/sh", "/bin/sh", "-c", command.c_str(), 0);
execl("/bin/sh", "/bin/sh", "-c", command.c_str(), static_cast<void*>(NULL));
exit(0); //exit child
}