From f5dffd06681427b047e941c88cd8de23549c5f77 Mon Sep 17 00:00:00 2001 From: Wolfgang Draxinger Date: Tue, 20 May 2025 17:05:40 +0200 Subject: seek reservoiur memfd to the start before executing command proper --- src/rsvr.c | 5 +++++ 1 file changed, 5 insertions(+) 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; -- cgit v1.2.3