www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/12/08/12:27:39

Date: Mon, 8 Dec 1997 19:23:17 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: djgpp-workers AT delorie DOT com
cc: DJ Delorie <dj AT delorie DOT com>
Subject: Another patch for `fstat', sigh...
Message-ID: <Pine.SUN.3.91.971208192050.4989J-100000@is>
MIME-Version: 1.0

This patch corrects a problem with files on the A: drive when running
under 32-bit File Access (Windows 3.11 or 9X).  Note that this bug was
lying there from the first v2.0 release... 

*** src/libc/posix/sys/stat/fstat.c~2	Sun Nov  9 16:42:28 1997
--- src/libc/posix/sys/stat/fstat.c	Mon Dec  8 18:10:08 1997
*************** fstat_assist(int fhandle, struct stat *s
*** 808,826 ****
            stat_buf->st_rdev = dev_info & 0x3f;
  #endif
  
!           /* Novell Netware returns 0 drive number in the lower
!            * 6 bits of dev_info.  If this is what we get, return -2
!            * as drive number (it will be converted to '?' if added to 'A').
             */
-           if (stat_buf->st_dev == 0)
-             {
-               stat_buf->st_dev = -2;
- #ifdef  HAVE_ST_RDEV
-               stat_buf->st_rdev = -2;
- #endif
-               _djstat_fail_bits |= _STFAIL_DEVNO;
-             }
- 
            stat_buf->st_size  = trusted_fsize;
            stat_buf->st_atime = stat_buf->st_ctime = stat_buf->st_mtime =
              _file_time_stamp(dos_ftime);
--- 808,818 ----
            stat_buf->st_rdev = dev_info & 0x3f;
  #endif
  
!           /* Novell Netware does not return the drive number in the
!            * lower 6 bits of dev_info.  But we cannot do anything with
!            * that, since any value in these 6 bits could be correct...
!            * In particular, 0 there means the A: drive.
             */
            stat_buf->st_size  = trusted_fsize;
            stat_buf->st_atime = stat_buf->st_ctime = stat_buf->st_mtime =
              _file_time_stamp(dos_ftime);

- Raw text -


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