diff --git a/sysfile.c b/sysfile.c
index 912ca7fc8070f962c480265eab47aca40f9333f0..b45032e1d5347c0e1ef374f71368561225922cfd 100644
--- a/sysfile.c
+++ b/sysfile.c
@@ -71,6 +71,8 @@ sys_pipe(void)
     fileclose(wf);
     return -1;
   }
+  fd[0] = fd0;
+  fd[1] = fd1;
   return 0;
 }