From 169c5400e16c48a2fe9692d6d8797ba943a668f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Sun, 17 May 1998 20:37:12 +0200 Subject: [PATCH] Added fallback SEEK_ macros. Rev: src/modules/Pipe/pipe.c:1.22 --- src/modules/Pipe/pipe.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/modules/Pipe/pipe.c b/src/modules/Pipe/pipe.c index 16ab3cd1fe..7b6523cfe4 100644 --- a/src/modules/Pipe/pipe.c +++ b/src/modules/Pipe/pipe.c @@ -22,7 +22,7 @@ #include <fcntl.h> #include "global.h" -RCSID("$Id: pipe.c,v 1.21 1998/04/20 18:53:46 grubba Exp $"); +RCSID("$Id: pipe.c,v 1.22 1998/05/17 18:37:12 grubba Exp $"); #include "threads.h" #include "stralloc.h" @@ -49,6 +49,17 @@ RCSID("$Id: pipe.c,v 1.21 1998/04/20 18:53:46 grubba Exp $"); #define BLOCKING_CLOSE */ +#ifndef SEEK_SET +#define SEEK_SET 0 +#endif /* SEEK_SET */ +#ifndef SEEK_CUR +#define SEEK_CUR 1 +#endif /* SEEK_CUR */ +#ifndef SEEK_END +#define SEEK_END 2 +#endif /* SEEK_END */ + + #if 0 #define INSISTANT_WRITE #endif @@ -265,8 +276,8 @@ static INLINE int append_buffer(struct pike_string *s) if(THIS->fd!= -1) { - lseek(THIS->fd,THIS->pos,0); - write(THIS->fd,s->str,s->len); + lseek(THIS->fd, THIS->pos, SEEK_SET); + write(THIS->fd, s->str, s->len); THIS->pos+=s->len; return 0; } @@ -422,7 +433,7 @@ static INLINE struct pike_string* gimme_some_data(unsigned long pos) len=this->pos-pos; if (len>READ_BUFFER_SIZE) len=READ_BUFFER_SIZE; THREADS_ALLOW(); - lseek(this->fd, pos, 0); /* SEEK_SET */ + lseek(this->fd, pos, SEEK_SET); THREADS_DISALLOW(); do { THREADS_ALLOW(); @@ -831,7 +842,7 @@ static void pipe_output(INT32 args) { b=THIS->firstbuffer; THIS->firstbuffer=b->next; - lseek(THIS->fd,THIS->pos,0); + lseek(THIS->fd, THIS->pos, SEEK_SET); write(THIS->fd,b->s->str,b->s->len); sbuffers-=b->s->len; nbuffers--; -- GitLab