aboutsummaryrefslogtreecommitdiff
path: root/rpt.c
diff options
context:
space:
mode:
authorTristan Riehs <tristan.riehs@bordeaux-inp.fr>2023-10-19 22:22:29 +0200
committerTristan Riehs <tristan.riehs@bordeaux-inp.fr>2023-10-19 22:22:29 +0200
commitfb811629ea6bf1837c2ae4de2ffa3f3207b28c75 (patch)
treed98f3cfb5b5f761c49dc721c777dd7a1f323bc40 /rpt.c
parentccecf92b8c46d3db1da634fe5cf8a92b226d51f6 (diff)
trying to redirect stdin
Diffstat (limited to 'rpt.c')
-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)