delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/03/31/15:25:20

Date: Sat, 31 Mar 2001 22:22:13 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: Martin Str|mberg <ams AT ludd DOT luth DOT se>
Message-Id: <3791-Sat31Mar2001222212+0200-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6
CC: djgpp-workers AT delorie DOT com
In-reply-to: <200103311757.TAA23410@mother.ludd.luth.se> (message from Martin
Str|mberg on Sat, 31 Mar 2001 19:57:43 +0200 (MEST))
Subject: Re: Bug00323, final? (LONG)
References: <200103311757 DOT TAA23410 AT mother DOT ludd DOT luth DOT se>
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

> From: Martin Str|mberg <ams AT ludd DOT luth DOT se>
> Date: Sat, 31 Mar 2001 19:57:43 +0200 (MEST)
>
> --- fopen.c	1995/08/23 07:49:24	1.1
> +++ fopen.c	2001/03/31 17:42:18
> @@ -1,3 +1,4 @@
> +/* Copyright (C) 2001 DJ Delorie, see COPYING.DJ for details */
>  /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
>  #include <libc/stubs.h>
>  #include <sys/types.h>
> @@ -29,7 +30,7 @@ fopen(const char *file, const char *mode
>    switch (*mode)
>    {
>    case 'a':
> -    oflags = O_CREAT | (rw ? O_RDWR : O_WRONLY);
> +    oflags = O_CREAT | (rw ? O_RDWR : O_WRONLY) | O_APPEND;
>      break;
>    case 'r':
>      oflags = rw ? O_RDWR : O_RDONLY;
> @@ -55,9 +56,6 @@ fopen(const char *file, const char *mode
>    if (fd < 0)
>      return NULL;
>  
> -  if (*mode == 'a')
> -    lseek(fd, 0, SEEK_END);
> -

What does ANSI C say about the file stream position right after it is
open with "a" mode?  If it says it should be at the file's end, you
cannot remove the above lseek.

> --- fcntl.c	2001/02/01 19:19:24	1.5
> +++ fcntl.c	2001/03/31 17:42:27
> @@ -408,7 +408,8 @@ fcntl(int fd, int cmd, ...)
>  
>      case F_GETFL:
>      {
> -      return 0;
> +      return 0; /* FIXME: should use the data in the SFT, and the
> +		   FILE_DESC_APPEND flag in __fd_properties */

Any reason not to do this now?

- Raw text -


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