www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/12/16/07:11:31

Date: Thu, 16 Dec 93 13:01:58 +0100
From: buers AT dg1 DOT chemie DOT uni-konstanz DOT de (Dieter Buerssner)
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: small bug in fstat() and fix

The fstat function in 1.11 (and earlier versions) does not
set the st_dev field correctly. This is probably caused by some
debugging code in go32/explhdl.c.
I suggest the following primitiv fix

	Dieter

*** exphdlr.oc	Sun Nov 28 04:06:54 1993
--- exphdlr.c	Thu Dec 16 17:34:08 1993
***************
*** 1120,1126 ****
          long  st_blksize;
  };
  
- static int dev_count=1;
  
  turbo_assist(void)
  {
--- 1120,1125 ----
***************
*** 1150,1156 ****
      case 3: /* fstat */
        memset(&statbuf, 0, sizeof(statbuf));
        r = fstat((int)p1, &statbuf);
!       statbuf32.st_dev = dev_count++;
        statbuf32.st_ino = statbuf.st_ino;
        statbuf32.st_mode = statbuf.st_mode;
        statbuf32.st_nlink = statbuf.st_nlink;
--- 1149,1155 ----
      case 3: /* fstat */
        memset(&statbuf, 0, sizeof(statbuf));
        r = fstat((int)p1, &statbuf);
!       statbuf32.st_dev = statbuf.st_dev;
        statbuf32.st_ino = statbuf.st_ino;
        statbuf32.st_mode = statbuf.st_mode;
        statbuf32.st_nlink = statbuf.st_nlink;
***************
*** 1210,1216 ****
        memset(&statbuf, 0, sizeof(statbuf));
        retrieve_string(p1+ARENA, transfer_buffer, 0);
        r = unixlike_stat(transfer_buffer, &statbuf);
!       statbuf32.st_dev = dev_count++;
        statbuf32.st_ino = statbuf.st_ino;
        statbuf32.st_mode = statbuf.st_mode;
        statbuf32.st_nlink = statbuf.st_nlink;
--- 1209,1215 ----
        memset(&statbuf, 0, sizeof(statbuf));
        retrieve_string(p1+ARENA, transfer_buffer, 0);
        r = unixlike_stat(transfer_buffer, &statbuf);
!       statbuf32.st_dev = statbuf.st_dev;
        statbuf32.st_ino = statbuf.st_ino;
        statbuf32.st_mode = statbuf.st_mode;
        statbuf32.st_nlink = statbuf.st_nlink;

- Raw text -


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