From 41362af7074bacf87fa1dde8dc1e4a8739b3b819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilhelm=20K=C3=B6hler?= <wk@cs.tu-berlin.de> Date: Thu, 20 Mar 1997 17:05:49 +0100 Subject: [PATCH] Applied WK's patch Rev: src/modules/Pipe/pipe.c:1.5 --- src/modules/Pipe/pipe.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/modules/Pipe/pipe.c b/src/modules/Pipe/pipe.c index 2e4dac10a1..fcd61f765d 100644 --- a/src/modules/Pipe/pipe.c +++ b/src/modules/Pipe/pipe.c @@ -20,7 +20,7 @@ #include <fcntl.h> #include "global.h" -RCSID("$Id: pipe.c,v 1.4 1997/03/17 03:09:45 hubbe Exp $"); +RCSID("$Id: pipe.c,v 1.5 1997/03/20 16:05:49 grubba Exp $"); #include "stralloc.h" #include "types.h" @@ -697,6 +697,9 @@ static void pipe_output(INT32 args) && S_ISREG(s.st_mode) && (THIS->fd=dup(fd))!=-1 ) { + /* keep the file pointer of the duped fd */ + THIS->pos=lseek(fd, 0L, SEEK_CUR); + #if 0 /* This won't work if the spider-module is dynamically linked. */ push_int(THIS->fd); @@ -720,7 +723,8 @@ static void pipe_output(INT32 args) } THIS->lastbuffer=NULL; - THIS->pos=0; + /* keep the file pointer of the duped fd + THIS->pos=0; */ push_int(0); apply(sp[-args-2].u.object,"set_id", 1); pop_n_elems(args+2); /* ... and from apply x 2 */ @@ -758,7 +762,9 @@ static void pipe_output(INT32 args) } o->mode=O_RUN; - o->pos=0; + /* keep the file pointer of the duped fd + o->pos=0; */ + o->pos=THIS->pos; push_object(obj); obj->refs++; -- GitLab