aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Draxinger <code@datenwolf.net>2025-05-20 17:05:40 +0200
committerWolfgang Draxinger <code@datenwolf.net>2025-05-20 17:05:40 +0200
commitf5dffd06681427b047e941c88cd8de23549c5f77 (patch)
treea615e03148f96e8298c59c6a2c0ca50651359404
parent3d5b3b8016e1bc932c386c46a4949e178d5985b9 (diff)
downloadrsvr-main.tar.gz
rsvr-main.tar.bz2
seek reservoiur memfd to the start before executing command properHEADmain
-rw-r--r--src/rsvr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rsvr.c b/src/rsvr.c
index 01fa845..cd23e31 100644
--- a/src/rsvr.c
+++ b/src/rsvr.c
@@ -44,6 +44,11 @@ int main(int argc, char *argv[])
if( 0 > wb ){ perror("write(reservoir)"); }
if( 0 > rb || 0 > wb ){ return EXIT_FAILURE; }
+ if( 0 > lseek(rsvr_fd, 0, SEEK_SET) ){
+ perror("lseek(reservoir, 0, SEEK_SET)");
+ return EXIT_FAILURE;
+ }
+
if( 0 > dup2(rsvr_fd, 0) ){
perror("dup2(reservoir, stdin)");
return EXIT_FAILURE;