diff options
author | Ron Yorston <rmy@pobox.com> | 2019-02-16 12:36:52 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2019-02-16 12:36:52 +0000 |
commit | d82db8e9a618ddd9a11cc57aff37f687abb0effb (patch) | |
tree | bd072e7344a3c3f0eff553d41c0f154c4470736e /editors/diff.c | |
parent | 91e49fbc7b55e8be78ac3ff943e9b7d4494dfe59 (diff) | |
download | busybox-w32-d82db8e9a618ddd9a11cc57aff37f687abb0effb.tar.gz busybox-w32-d82db8e9a618ddd9a11cc57aff37f687abb0effb.tar.bz2 busybox-w32-d82db8e9a618ddd9a11cc57aff37f687abb0effb.zip |
win32: make stat(2) fetch additional metadata
Modify the WIN32 implementation of stat(2) to fetch inode number,
device id and number of hardlinks. This requires opening a handle
to the target file so it will be slower.
A number of features can be enabled or start to work:
- tar can detect if an archive is being stored in itself;
- find can support the -inum and -links options;
- ls can display inode numbers;
- diff can detect attempts to compare a file with itself;
- du has better support for hardlinked files;
- cp can detect attempts to copy a file over itself.
Diffstat (limited to 'editors/diff.c')
-rw-r--r-- | editors/diff.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/editors/diff.c b/editors/diff.c index 929beb054..815c8a915 100644 --- a/editors/diff.c +++ b/editors/diff.c | |||
@@ -1039,7 +1039,8 @@ int diff_main(int argc UNUSED_PARAM, char **argv) | |||
1039 | * single NFS file system, if a local device number (st_dev) exceeds | 1039 | * single NFS file system, if a local device number (st_dev) exceeds |
1040 | * 255, or if a local inode number (st_ino) exceeds 16777215. | 1040 | * 255, or if a local inode number (st_ino) exceeds 16777215. |
1041 | */ | 1041 | */ |
1042 | if (ENABLE_DESKTOP && !ENABLE_PLATFORM_MINGW32 | 1042 | if (ENABLE_DESKTOP |
1043 | && (!ENABLE_PLATFORM_MINGW32 || ENABLE_FEATURE_EXTRA_FILE_DATA) | ||
1043 | && stb[0].st_ino == stb[1].st_ino | 1044 | && stb[0].st_ino == stb[1].st_ino |
1044 | && stb[0].st_dev == stb[1].st_dev | 1045 | && stb[0].st_dev == stb[1].st_dev |
1045 | && stb[0].st_size == stb[1].st_size | 1046 | && stb[0].st_size == stb[1].st_size |