Index: head/ports-mgmt/pkg-devel/files/patch-better-stdin-handling =================================================================== --- head/ports-mgmt/pkg-devel/files/patch-better-stdin-handling (nonexistent) +++ head/ports-mgmt/pkg-devel/files/patch-better-stdin-handling (revision 502342) @@ -0,0 +1,47 @@ +diff --git libpkg/scripts.c libpkg/scripts.c +index 04667af1..489b46d7 100644 +--- libpkg/scripts.c ++++ libpkg/scripts.c +@@ -35,6 +35,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -59,6 +60,7 @@ pkg_script_run(struct pkg * const pkg, pkg_script type) + const char *argv[4]; + char **ep; + int ret = EPKG_OK; ++ int fd = -1; + int stdin_pipe[2] = {-1, -1}; + posix_spawn_file_actions_t action; + bool use_pipe = 0; +@@ -157,8 +159,15 @@ pkg_script_run(struct pkg * const pkg, pkg_script type) + + use_pipe = 1; + } else { +- posix_spawn_file_actions_addclose(&action, +- STDIN_FILENO); ++ fd = open("/dev/null", O_RDWR); ++ if (fd < 0) { ++ pkg_errno("Cannot open %s", "/dev/null"); ++ ret = EPKG_FATAL; ++ posix_spawn_file_actions_destroy(&action); ++ goto cleanup; ++ } ++ posix_spawn_file_actions_adddup2(&action, ++ fd, STDIN_FILENO); + + argv[0] = _PATH_BSHELL; + argv[1] = "-c"; +@@ -178,6 +187,8 @@ pkg_script_run(struct pkg * const pkg, pkg_script type) + } + posix_spawn_file_actions_destroy(&action); + ++ if (fd != -1) ++ close(fd); + if (use_pipe) { + script_cmd_p = utstring_body(script_cmd); + script_cmd_len = utstring_len(script_cmd); Property changes on: head/ports-mgmt/pkg-devel/files/patch-better-stdin-handling ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property