Date: Tue, 14 Aug 2001 18:26:50 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: acottrel AT ihug DOT com DOT au Message-Id: <6480-Tue14Aug2001182649+0300-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9 CC: djgpp-workers AT delorie DOT com In-reply-to: <013d01c124bc$b4b1fe60$0a02a8c0@acceleron> (acottrel@ihug.com.au) Subject: Re: Fw: Fstat.c patch References: <00fe01c12311$92957890$0a02a8c0 AT acceleron> <4331-Mon13Aug2001125532+0300-eliz AT is DOT elta DOT co DOT il> <019701c123f9$6febae70$0a02a8c0 AT acceleron> <557-Mon13Aug2001165656+0300-eliz AT is DOT elta DOT co DOT il> <028c01c12405$d1b326e0$0a02a8c0 AT acceleron> <013d01c124bc$b4b1fe60$0a02a8c0 AT acceleron> Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: "Andrew Cottrell" > Date: Tue, 14 Aug 2001 22:29:03 +1000 > > If I recompile CP from fileutils using only the relevant files and step > through the code then the code does NOT set up the dos_major variable, it's > set to zero. I have traced this to the djstart.c program which sets the > _djstat_flags to 0x34 in the static init_stat_bits() function. The > definition for _STAT_NEEDS_SFT is 0x23 and as such if I and these together I > do NOT get 0 and as such the GNUC compiler does not call the get_sft_entry() > which in turn initalises the dos_version function. Right, I forgot about that djstart gork. > > /* Get pointer to an SFT entry which holds data for our handle. */ > > if ( (_djstat_flags & _STAT_NEEDS_SFT) == 0 && > > (sft_idx = get_sft_entry(fhandle)) == -1) > > { > > errno = EBADF; > > return -1; > > } > > Now for the queries to help me try to find a correct solution: > 1) Is it expected that the get_sft_entry() is not called in the scenario > above? Yes, it is expected: if _STAT_NEEDS_SFT is set, it means `fstat' doesn't need any of the info it gets from the SFT. > 2) Is it expected that the dos_major is setup even if the get_sft_entry() is > not called? (I think the answer is yes) Yes, expected. > 3) Any suggestions as to where to head with this issue? It's a bug: the if clause that checks whether to call function 71A6 should have used _osmajor, which is always set. There's no reason to condition it on the true DOS version. Thanks for hunting this down.