Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » UPP_MAIN__ is not exported to env in linux
Re: UPP_MAIN__ is not exported to env in linux [message #6333 is a reply to message #6331] |
Tue, 07 November 2006 00:30   |
zsolt
Messages: 702 Registered: December 2005 Location: Budapest, Hungary
|
Contributor |
|
|
I made them a little bit more elegant.
In Ide/Host.cpp, the end of void LocalHost::Launch(const char *_cmdline, bool console) method is:
pid_t pid = fork();
if(pid == 0)
{
const char *from = environment;
Vector<const char *> env;
while(*from)
{
env.Add(from);
from += strlen(from) + 1;
}
env.Add(NULL);
const char **envp = env.Begin();
execve(args[0], args, (char *const *)envp);
}
sPid().Add(pid);
#endif
Web/sproc.cpp in void LocalSlaveProcess::Open(const char *command, const char *envptr) method:
#if DO_SVRLOG
SVRLOG(args.GetCount() << "arguments:");
for(int a = 0; a < args.GetCount(); a++)
SVRLOG("[" << a << "]: <" << (args[a] ? args[a] : "NULL") << ">");
#endif//DO_SVRLOG
SVRLOG("running execve, app = " << app << ", #args = " << args.GetCount());
const char *from = envptr;
Vector<const char *> env;
while(*from)
{
env.Add(from);
from += strlen(from) + 1;
}
env.Add(NULL);
const char **envp = env.Begin();
execve(app_full, args.Begin(), (char *const *)envp);
SVRLOG("execve failed, errno = " << errno);
printf("Error running '%s', error code %d\n", command, errno);
exit(-errno);
#endif
|
|
|
Goto Forum:
Current Time: Mon Apr 28 20:41:24 CEST 2025
Total time taken to generate the page: 0.00496 seconds
|