Branch: Tag:

1998-05-17

1998-05-17 18:37:12 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Added fallback SEEK_ macros.

Rev: src/modules/Pipe/pipe.c:1.22

22:   #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:   #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:       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:    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:    {    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--;