chiark / gitweb /
prefork-interp: fixes
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 19 Aug 2022 19:19:17 +0000 (20:19 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 21 Aug 2022 20:21:10 +0000 (21:21 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
cprogs/prefork-interp.c

index ec43bcf9de2dc560d04408c1727af1037dc58609..56e848ad1adcceb8d9f64303d6abd43287a30821 100644 (file)
@@ -456,8 +456,8 @@ void become_setup(int sfd, int fake_pair[2],
   // different after the connect) by putting a name for it comma-separated
   // next to "v1".  Simple extension can be done by having the script
   // side say something about it in the ack xdata, which we currently ignore.
-  putenv(m_asprintf("PREFORK_INTERP=v1 %d,%d %s",
-                   sfd, call_fd, socket_path, watcher_stdin, watcher_stderr));
+  putenv(m_asprintf("PREFORK_INTERP=v1 %d,%d,%d,%d",
+                   sfd, call_fd, watcher_stdin, watcher_stderr));
 
   execvp(executor_argv[0], (char**)executor_argv);
   diee("execute %s", executor_argv[0]);
@@ -511,7 +511,7 @@ static void connect_or_spawn(void) {
     close(watcher_stdin[1]);
     close(watcher_stderr[0]);
     if (dup2(watcher_stdin[0], 0) != 0 ||
-       dup2(watcher_stderr[1], 1) != 0)
+       dup2(watcher_stderr[1], 1) != 1)
       diee("initial dup2() for watcher");
     close(watcher_stdin[0]);
     close(watcher_stderr[1]);