delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/01/31/03:53:02

From: Martin Stromberg <eplmst AT lu DOT erisoft DOT se>
Message-Id: <200101310852.JAA06693@lws256.lu.erisoft.se>
Subject: Re: Bug000323
To: djgpp-workers AT delorie DOT com
Date: Wed, 31 Jan 2001 09:52:07 +0100 (MET)
In-Reply-To: <200101302214.RAA24294@envy.delorie.com> from "DJ Delorie" at Jan 30, 2001 05:14:00 PM
X-Mailer: ELM [version 2.5 PL3]
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> > Index: src/libc/ansi/stdio/doprnt.c
> > +
> > +  if (fp->_flag & _IOAPPEND)
> > +  {
> > +    if ( llseek(fileno(fp), 0, SEEK_END) == -1 )
> > +    {
> > +      return (EOF);
> > +    }
> > +  }
> 
> This shouldn't be needed; the flsbuf() call should move to EOF.

Well, I tried without it and it didn't work.

> > @@ -56,7 +57,9 @@ fopen(const char *file, const char *mode
> >      return NULL;
> >  
> >    if (*mode == 'a')
> > -    lseek(fd, 0, SEEK_END);
> > +  {
> > +    f->_flag |= _IOAPPEND;
> > +  }
> 
> Is this needed?  write() would seek there anyway.

It would? Why would it do that if _IOAPPEND wasn't set?


Right,

						MartinS

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019