Skip to content
Snippets Groups Projects
Commit fd36c6bd authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

closed on exec now updated only at fork() or exec(), typo fixed in efuns.c

Rev: src/modules/files/efuns.c:1.15
Rev: src/modules/files/socket.c:1.6
parent 1cd08017
No related branches found
No related tags found
No related merge requests found
...@@ -162,7 +162,7 @@ void f_mkdir(INT32 args) ...@@ -162,7 +162,7 @@ void f_mkdir(INT32 args)
push_int(i); push_int(i);
} }
#undef HAVE_REDDIR_R #undef HAVE_READDIR_R
#if defined(HAVE_SOLARIS_READDIR_R) || defined(HAVE_SOLARIS_HPUX_R) || \ #if defined(HAVE_SOLARIS_READDIR_R) || defined(HAVE_SOLARIS_HPUX_R) || \
defined(HAVE_POSIX_R) defined(HAVE_POSIX_R)
#define HAVE_READDIR_R #define HAVE_READDIR_R
...@@ -349,6 +349,7 @@ void f_getcwd(INT32 args) ...@@ -349,6 +349,7 @@ void f_getcwd(INT32 args)
void f_fork(INT32 args) void f_fork(INT32 args)
{ {
do_set_close_on_exec();
pop_n_elems(args); pop_n_elems(args);
#if defined(HAVE_FORK1) && defined(_REENTRANT) #if defined(HAVE_FORK1) && defined(_REENTRANT)
push_int(fork1()); push_int(fork1());
...@@ -438,9 +439,11 @@ void f_exece(INT32 args) ...@@ -438,9 +439,11 @@ void f_exece(INT32 args)
env=environ; env=environ;
} }
set_close_on_exec(0,0); my_set_close_on_exec(0,0);
set_close_on_exec(1,0); my_set_close_on_exec(1,0);
set_close_on_exec(2,0); my_set_close_on_exec(2,0);
do_set_close_on_exec();
execve(argv[0],argv,env); execve(argv[0],argv,env);
......
...@@ -191,7 +191,7 @@ static void port_bind(INT32 args) ...@@ -191,7 +191,7 @@ static void port_bind(INT32 args)
return; return;
} }
set_close_on_exec(fd,1); my_set_close_on_exec(fd,1);
MEMSET((char *)&addr,0,sizeof(struct sockaddr_in)); MEMSET((char *)&addr,0,sizeof(struct sockaddr_in));
...@@ -298,10 +298,7 @@ static void port_accept(INT32 args) ...@@ -298,10 +298,7 @@ static void port_accept(INT32 args)
return; return;
} }
tmp=1; my_set_close_on_exec(fd,1);
setsockopt(fd,SOL_SOCKET, SO_KEEPALIVE, (char *)&tmp, sizeof(tmp));
set_close_on_exec(fd,1);
o=file_make_object_from_fd(fd,FILE_READ | FILE_WRITE); o=file_make_object_from_fd(fd,FILE_READ | FILE_WRITE);
pop_n_elems(args); pop_n_elems(args);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment