Selaa lähdekoodia

Try to disable pid_wait on chain_run_sync along with piping on Win

rexim 4 vuotta sitten
vanhempi
sitoutus
8a73633e55
2 muutettua tiedostoa jossa 9 lisäystä ja 13 poistoa
  1. 6 10
      examples/pipe.c
  2. 3 3
      nobuild2.h

+ 6 - 10
examples/pipe.c

@@ -3,16 +3,12 @@
 
 int main(void)
 {
-    INFO("------------------------------");
-    INFO("PIPE EXAMPLE GOES HERE");
-    INFO("------------------------------");
-
-    // CHAIN(IN(PATH("examples", "pipe.c")),
-    //       CHAIN_CMD(PATH("tools", "rot13"))//,
-    //       // CHAIN_CMD(PATH("tools", "hex")),
-    //       // OUT("output.txt")
-    //       );
-    // CMD(PATH("tools", "cat"), "output.txt");
+    CHAIN(IN(PATH("examples", "pipe.c")),
+          CHAIN_CMD(PATH("tools", "rot13"))//,
+          // CHAIN_CMD(PATH("tools", "hex")),
+          // OUT("output.txt")
+          );
+    CMD(PATH("tools", "cat"), "output.txt");
 
     // sleep(1);
 

+ 3 - 3
nobuild2.h

@@ -816,9 +816,9 @@ void chain_run_sync(Chain chain)
         if (fdnext) fd_close(*fdnext);
     }
 
-    for (size_t i = 0; i < chain.cmds.count; ++i) {
-        pid_wait(cpids[i]);
-    }
+    // for (size_t i = 0; i < chain.cmds.count; ++i) {
+    //     pid_wait(cpids[i]);
+    // }
 }
 
 void chain_echo(Chain chain)