aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-01-23 10:40:57 +0000
committerRon Yorston <rmy@pobox.com>2023-01-23 10:40:57 +0000
commit1a88782fd33db4ad3531b63c9fb744c64282fee2 (patch)
tree65e826528ab2f57ebfb12c74e9b13898157de783 /include
parentafbf21c45d2e6a710aa27cb2784a540bb3ceedea (diff)
downloadbusybox-w32-1a88782fd33db4ad3531b63c9fb744c64282fee2.tar.gz
busybox-w32-1a88782fd33db4ad3531b63c9fb744c64282fee2.tar.bz2
busybox-w32-1a88782fd33db4ad3531b63c9fb744c64282fee2.zip
win32: only count subdirectories if necessary
Commit 7fb95a2a5 (win32: try to get link count for directories) allowed stat(2) to report accurate values of st_nlink for directories. There are only a couple of places in busybox-w32 where these values are required. Disable counting of subdirectories by default and only enable it when necessary. Microsoft kindly provide directories to test edge cases like this: C:/Windows/WinSxS (contains many subdirectories) C:/Windows/WinSxS/Manifests (contains many files) Adds 84-112 bytes.
Diffstat (limited to 'include')
-rw-r--r--include/mingw.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/mingw.h b/include/mingw.h
index 4c3354864..6259bc2c6 100644
--- a/include/mingw.h
+++ b/include/mingw.h
@@ -349,6 +349,7 @@ struct mingw_stat {
349#define st_mtime st_mtim.tv_sec 349#define st_mtime st_mtim.tv_sec
350#define st_ctime st_ctim.tv_sec 350#define st_ctime st_ctim.tv_sec
351 351
352int count_subdirs(const char *pathname);
352int mingw_lstat(const char *file_name, struct mingw_stat *buf); 353int mingw_lstat(const char *file_name, struct mingw_stat *buf);
353int mingw_stat(const char *file_name, struct mingw_stat *buf); 354int mingw_stat(const char *file_name, struct mingw_stat *buf);
354int mingw_fstat(int fd, struct mingw_stat *buf); 355int mingw_fstat(int fd, struct mingw_stat *buf);