delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/02/01/01:35:59

From: Dave Mason <dmason AT scs DOT Ryerson DOT CA>
To: DJ Delorie <dj AT ctron DOT com>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Bug in exphdlr.c
Date: Tue, 1 Feb 1994 01:19:43 -0500

Here's the header and a section around line 670
-----------
/* This is file EXPHDLR.C */
/* Modified for VCPI Implement by Y.Shibata Aug 5th 1991 */
/* Modified for DPMI Implement by H.Tsubakimoto */
/* Merged DPMI with V1.09+ C. Sandmann sandmann AT clio DOT rice DOT edu */
/* History:66,55 */
    case 0x3d: /* open */
      v = tss_ptr->tss_edx + ARENA;
      CHECK_SEGFAULT(v)
      retrieve_string(v, transfer_buffer, 0);
      i = (word16)(tss_ptr->tss_eax) & 0xf0;
      if (tss_ptr->tss_eax & O_WRONLY) i &= 1;
      if (tss_ptr->tss_eax & O_RDWR) i &= 2;
      i = _open(transfer_buffer, i);
      if (i < 0)
      {
        tss_ptr->tss_eax = errno;
        tss_ptr->tss_eflags |= 1;
      }
      else
      {
        tss_ptr->tss_eax = i;
        tss_ptr->tss_eflags &= ~1;
      }
      return 0;
-----------
Sure looks to me like those lines should be:

      if (tss_ptr->tss_eax & O_WRONLY) i |= 1;
      if (tss_ptr->tss_eax & O_RDWR) i |= 2;

As it stands, there's no way to open a file for shared read-write.  If
this was right, I think I have a locking function almost working.

Any chance that someone can build a correct version and send me a new
binary or a binary patch (should just be an ``and'' converted to an
``or'').  Unfortunately I don't have the right environment to build it
myself.

Thanks	../Dave

- Raw text -


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