Page MenuHomeFreeBSD

D50537.diff
No OneTemporary

D50537.diff

diff --git a/libexec/flua/modules/lfbsd.c b/libexec/flua/modules/lfbsd.c
--- a/libexec/flua/modules/lfbsd.c
+++ b/libexec/flua/modules/lfbsd.c
@@ -88,13 +88,22 @@
argv = luaL_checkarraystrings(L, 1);
if (0 != (r = posix_spawnp(&pid, argv[0], &action, NULL,
(char*const*)argv, environ))) {
+ close(stdin_pipe[0]);
+ close(stdin_pipe[1]);
+ posix_spawn_file_actions_destroy(&action);
+
lua_pushnil(L);
lua_pushstring(L, strerror(r));
lua_pushinteger(L, r);
return (3);
}
+
+ close(stdin_pipe[0]);
+ posix_spawn_file_actions_destroy(&action);
+
while (waitpid(pid, &pstat, 0) == -1) {
if (errno != EINTR) {
+ close(stdin_pipe[1]);
lua_pushnil(L);
lua_pushstring(L, strerror(r));
lua_pushinteger(L, r);
@@ -109,12 +118,7 @@
return (3);
}
- posix_spawn_file_actions_destroy(&action);
-
- if (stdin_pipe[0] != -1)
- close(stdin_pipe[0]);
- if (stdin_pipe[1] != -1)
- close(stdin_pipe[1]);
+ close(stdin_pipe[1]);
lua_pushinteger(L, pid);
return 1;
}

File Metadata

Mime Type
text/plain
Expires
Mon, Sep 7, 1:21 AM (18 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38443231
Default Alt Text
D50537.diff (1002 B)

Event Timeline