Date: Mon, 8 Dec 1997 19:23:17 +0200 (IST) From: Eli Zaretskii To: djgpp-workers AT delorie DOT com cc: DJ Delorie Subject: Another patch for `fstat', sigh... Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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);