diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2012-04-11 08:49:52 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2012-04-11 08:49:52 +0000 |
commit | e62d782aeca47eb36ac0c287c801a5d9fe61c7e6 (patch) | |
tree | 9acdf7585827072d0ac4a4b5d20537f79b85e143 /winsup/cygwin/syscalls.cc | |
parent | a281df5589140857cbcbfcd2b4dd16bf35ec49f0 (diff) | |
download | newlib-e62d782aeca47eb36ac0c287c801a5d9fe61c7e6.zip newlib-e62d782aeca47eb36ac0c287c801a5d9fe61c7e6.tar.gz newlib-e62d782aeca47eb36ac0c287c801a5d9fe61c7e6.tar.bz2 |
* syscalls.cc (fhandler_base::stat_fixup): Fix inode numbers of
non-device files in virtual fileysystems.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r-- | winsup/cygwin/syscalls.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 3ea4a6f..9fc4a29 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -1591,10 +1591,11 @@ static bool dev_st_inited; void fhandler_base::stat_fixup (struct __stat64 *buf) { - /* Set inode number to device number. This gives us a valid, unique - inode number and we especially don't have to call hash_path_name. */ + /* For devices, set inode number to device number. This gives us a valid, + unique inode number without having to call hash_path_name. */ if (!buf->st_ino) - buf->st_ino = get_device (); + buf->st_ino = (get_major () == DEV_VIRTFS_MAJOR) ? get_ino () + : get_device (); /* For /dev-based devices, st_dev must be set to the device number of /dev, not it's own device major/minor numbers. What we do here to speed up the process is to fetch the device number of /dev only once, liberally |