aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rpt.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/rpt.c b/rpt.c
index 82e2c95..cf466c0 100644
--- a/rpt.c
+++ b/rpt.c
@@ -63,6 +63,22 @@ exec_child(char **argv)
{
int status;
+ status = lseek(STDIN_FILENO, 0, L_SET);
+
+ if (status < 0)
+ {
+ perror("rpt[child process]");
+ exit(4);
+ }
+
+ status = dup2(dup(clone_fd), STDIN_FILENO);
+
+ if (status < 0)
+ {
+ perror("rpt[child process]");
+ exit(4);
+ }
+
status = execvp(argv[0], argv);
if (status < 0)