diff options
author | Michihiro NAKAJIMA <ggcueroad@gmail.com> | 2009-03-06 08:02:36 -0500 |
---|---|---|
committer | Michihiro NAKAJIMA <ggcueroad@gmail.com> | 2009-03-06 08:02:36 -0500 |
commit | c0f0e5e43c72a78cb7994b49f1252bf48783e848 (patch) | |
tree | f00e60a7e65d8249b071100c4e63361256841480 /cpio/cpio_windows.c | |
parent | 33d7195d1d546a6c41af038462982e684a8d0bdc (diff) | |
download | libarchive-c0f0e5e43c72a78cb7994b49f1252bf48783e848.tar.gz |
On Windows, simulate POSIX stat. Add a reference count
of its parent directory to a link count of the directory.
SVN-Revision: 735
Diffstat (limited to 'cpio/cpio_windows.c')
-rw-r--r-- | cpio/cpio_windows.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cpio/cpio_windows.c b/cpio/cpio_windows.c index 8546b9e7..60566fbc 100644 --- a/cpio/cpio_windows.c +++ b/cpio/cpio_windows.c @@ -788,6 +788,8 @@ __hstat(HANDLE handle, struct ustat *st) ino64.LowPart = info.nFileIndexLow; st->st_ino = ino64.QuadPart; st->st_nlink = info.nNumberOfLinks; + if (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + ++st->st_nlink;/* Add parent directory. */ st->st_dev = info.dwVolumeSerialNumber; #endif st->st_uid = 0; |