diff options
author | Ron Yorston <rmy@pobox.com> | 2021-02-12 14:02:28 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2021-02-12 14:02:28 +0000 |
commit | e86a3ddd8b60eb0720874f5b9679446d12a1ac41 (patch) | |
tree | f35332dccaec68bfd182f705dcec0b2297d3a578 /coreutils | |
parent | 90f35327c2f31b7e4d938bf4d54e5526e53daee0 (diff) | |
download | busybox-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')
-rw-r--r-- | coreutils/ls.c | 2 | ||||
-rw-r--r-- | coreutils/stat.c | 7 |
2 files changed, 0 insertions, 9 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c index e891a67ce..67f6c8c56 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
@@ -495,11 +495,9 @@ static NOINLINE unsigned display_single(const struct dnode *dn) | |||
495 | /* Do readlink early, so that if it fails, error message | 495 | /* Do readlink early, so that if it fails, error message |
496 | * does not appear *inside* the "ls -l" line */ | 496 | * does not appear *inside* the "ls -l" line */ |
497 | lpath = NULL; | 497 | lpath = NULL; |
498 | #if ENABLE_PLATFORM_POSIX || ENABLE_FEATURE_READLINK2 | ||
499 | if (opt & OPT_l) | 498 | if (opt & OPT_l) |
500 | if (S_ISLNK(dn->dn_mode)) | 499 | if (S_ISLNK(dn->dn_mode)) |
501 | lpath = xmalloc_readlink_or_warn(dn->fullname); | 500 | lpath = xmalloc_readlink_or_warn(dn->fullname); |
502 | #endif | ||
503 | 501 | ||
504 | if (opt & OPT_i) /* show inode# */ | 502 | if (opt & OPT_i) /* show inode# */ |
505 | #if !ENABLE_FEATURE_EXTRA_FILE_DATA | 503 | #if !ENABLE_FEATURE_EXTRA_FILE_DATA |
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); |