Mail Archives: djgpp-workers/2003/03/20/05:08:27
> Are you saying that the current code does _not_ invent inodes on
> Windows/XP? I'd be surprised, I thought we invent inodes for any
> kind of files on all the versions of Windows except 3.1.
If the invent_inode is not passed a name then under Windows 2K/XP the inode
number may change between calls and as such cause failures in directory
tranversial programs. It appears to be okay on Win 9x/DOS, but fails on
2K/XP.
In the following email you can see a patch that I did to fix the cases that
I was aware of, but the solution did not fix all cases from what I can
remember.
http://www.delorie.com/djgpp/mail-archives/browse.cgi?p=djgpp-workers/2003/0
2/08/23:50:22
The main line that was changed was:-
From: stat_buf->st_ino = _invent_inode("", dos_ftime,trusted_fsize);
To: stat_buf->st_ino = _invent_inode(fixed_filename, dos_ftime,
trusted_fsize);
As you can see _invent_inode passed NULL as the name and now uses the fixed
file name.
The original info on this can be seen in the following email:-
http://www.delorie.com/djgpp/mail-archives/browse.cgi?p=djgpp-workers/2002/0
9/15/03:27:43
Excert from the email:-
The reason for this is that in xstat.c the following piece of code is
executed if no filename is used in the _invent_inode as is the case in
fstat, but not the case for lstat
The offending line in stat.c whcih is a few lines above the symlink check
for trusted_fsize == 510 :
stat_buf->st_ino = _invent_inode("", dos_ftime,
trusted_fsize);
/* If the passed name is empty, invent a new inode unconditionally.
* This is for those unfortunate circumstances where we couldn't
* get a name (e.g., fstat() under Novell). For these we want at
* least to ensure that no two calls will get the same inode number.
* The lossage here is that you get different inodes even if you call
* twice with the same file. Sigh...
*/
if (!*name)
{
ino_t retval = inode_count;
inode_count++;
return retval;
}
Hope this helps and does not confuse the issue more.
Regards,
Andrew
- Raw text -