aboutsummaryrefslogtreecommitdiff
path: root/coreutils/stat.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-02-12 14:02:28 +0000
committerRon Yorston <rmy@pobox.com>2021-02-12 14:02:28 +0000
commite86a3ddd8b60eb0720874f5b9679446d12a1ac41 (patch)
treef35332dccaec68bfd182f705dcec0b2297d3a578 /coreutils/stat.c
parent90f35327c2f31b7e4d938bf4d54e5526e53daee0 (diff)
downloadbusybox-w32-e86a3ddd8b60eb0720874f5b9679446d12a1ac41.tar.gz
busybox-w32-e86a3ddd8b60eb0720874f5b9679446d12a1ac41.tar.bz2
busybox-w32-e86a3ddd8b60eb0720874f5b9679446d12a1ac41.zip
win32: make readlink(2) implementation unconditional
There doesn't seem to be much advantage in having readlink(2) as a configuration option. Making it unconditional reduces divergence from upstream and allows the removal of a check for ENOSYS that's been in busybox-w32 since the start.
Diffstat (limited to 'coreutils/stat.c')
-rw-r--r--coreutils/stat.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/coreutils/stat.c b/coreutils/stat.c
index 1e93dce80..96cbf6dc6 100644
--- a/coreutils/stat.c
+++ b/coreutils/stat.c
@@ -314,7 +314,6 @@ static void FAST_FUNC print_stat(char *pformat, const char m,
314 struct passwd *pw_ent; 314 struct passwd *pw_ent;
315 struct group *gw_ent; 315 struct group *gw_ent;
316 316
317#if ENABLE_PLATFORM_POSIX || ENABLE_FEATURE_READLINK2
318 if (m == 'n') { 317 if (m == 'n') {
319 printfs(pformat, filename); 318 printfs(pformat, filename);
320 } else if (m == 'N') { 319 } else if (m == 'N') {
@@ -328,10 +327,6 @@ static void FAST_FUNC print_stat(char *pformat, const char m,
328 } else { 327 } else {
329 printf(pformat, filename); 328 printf(pformat, filename);
330 } 329 }
331#else
332 if (m == 'n' || m == 'N') {
333 printfs(pformat, filename);
334#endif
335 } else if (m == 'd') { 330 } else if (m == 'd') {
336 strcat(pformat, "llu"); 331 strcat(pformat, "llu");
337 printf(pformat, (unsigned long long) statbuf->st_dev); 332 printf(pformat, (unsigned long long) statbuf->st_dev);
@@ -715,10 +710,8 @@ static bool do_stat(const char *filename, const char *format)
715 gw_ent = getgrgid(statbuf.st_gid); 710 gw_ent = getgrgid(statbuf.st_gid);
716 pw_ent = getpwuid(statbuf.st_uid); 711 pw_ent = getpwuid(statbuf.st_uid);
717 712
718#if ENABLE_PLATFORM_POSIX || ENABLE_FEATURE_READLINK2
719 if (S_ISLNK(statbuf.st_mode)) 713 if (S_ISLNK(statbuf.st_mode))
720 linkname = xmalloc_readlink_or_warn(filename); 714 linkname = xmalloc_readlink_or_warn(filename);
721#endif
722 if (linkname) { 715 if (linkname) {
723 printf(" File: '%s' -> '%s'\n", filename, linkname); 716 printf(" File: '%s' -> '%s'\n", filename, linkname);
724 free(linkname); 717 free(linkname);