cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/15/19:32:31

From: bukinm AT inp DOT nsk DOT su (Michael Bukin)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Desperately need help with "fopen"
Date: Tue, 15 Apr 1997 14:16:27 GMT
Organization: BINP SD RAS
Lines: 34
Message-ID: <335486e0.7212119@news-win.inp.nsk.su>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 970415120826 DOT 12996O-100000 AT is>
Reply-To: bukinm AT inp DOT nsk DOT su
NNTP-Posting-Host: csd-bsdi.inp.nsk.su
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Tue, 15 Apr 1997 09:11:41 GMT, Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
wrote:

> Thanks.  But I wanted to ask you to change the source of `fopen' so that 
> it tries to call `open' once in compatinility mode, and if that fails, 
> call it again with DENYNONE bit.  Can you please do that and see if that 
> solves the problem?

  Yes, it does. Here is a patch that was used:

*** src/libc/ansi/stdio/fopen.c	Wed Aug 23 03:49:24 1995
--- src/libc/ansi/stdio/fopen.c	Tue Apr 15 18:57:02 1997
***************
*** 53,59 ****
  
    fd = open(file, oflags, 0666);
    if (fd < 0)
!     return NULL;
  
    if (*mode == 'a')
      lseek(fd, 0, SEEK_END);
--- 53,63 ----
  
    fd = open(file, oflags, 0666);
    if (fd < 0)
!     {
!       fd = open(file, oflags | SH_DENYNO, 0666);
!       if (fd < 0)
!         return NULL;
!     }
  
    if (*mode == 'a')
      lseek(fd, 0, SEEK_END);
  

- Raw text -


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