Skip to content
Snippets Groups Projects
Commit 88dba7b1 authored by Per Hedbor's avatar Per Hedbor
Browse files

Fork now sets num_threads to 1

Rev: src/modules/files/efuns.c:1.35
parent 16797cfd
No related branches found
No related tags found
No related merge requests found
......@@ -509,12 +509,20 @@ void f_getcwd(INT32 args)
void f_fork(INT32 args)
{
int res;
do_set_close_on_exec();
pop_n_elems(args);
#if defined(HAVE_FORK1) && defined(_REENTRANT)
push_int(fork1());
push_int(res=fork1());
#else
push_int(fork());
push_int(res=fork());
#endif
#if defined(_REENTRANT)
if(!res)
{
/* forked copy. there is now only one thread running, this one. */
num_threads=1;
}
#endif
}
......@@ -604,7 +612,6 @@ void f_exece(INT32 args)
my_set_close_on_exec(2,0);
do_set_close_on_exec();
execve(argv[0],argv,env);
free((char *)argv);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment