aboutsummaryrefslogtreecommitdiff
path: root/coreutils/ls.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2018-04-10 21:52:58 +0100
committerRon Yorston <rmy@pobox.com>2018-04-10 21:52:58 +0100
commit0038f9d39a306c3c7860756f03102de217dc5cd9 (patch)
tree4ce098f303e70d397d31683bdd37874a87b817b5 /coreutils/ls.c
parent072edb130eaabd50961df71156c3ca7d0773d690 (diff)
downloadbusybox-w32-0038f9d39a306c3c7860756f03102de217dc5cd9.tar.gz
busybox-w32-0038f9d39a306c3c7860756f03102de217dc5cd9.tar.bz2
busybox-w32-0038f9d39a306c3c7860756f03102de217dc5cd9.zip
ls, stat: don't try to read symlinks
Currently the WIN32 emulation of readlink(2) fails with ENOSYS. This causes ugly error messages in ls and stat. Don't even try calling readlink(2) and skip any code that uses the name it doesn't return.
Diffstat (limited to 'coreutils/ls.c')
-rw-r--r--coreutils/ls.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 4cc9517b1..b0c543d28 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -492,9 +492,11 @@ static NOINLINE unsigned display_single(const struct dnode *dn)
492 /* Do readlink early, so that if it fails, error message 492 /* Do readlink early, so that if it fails, error message
493 * does not appear *inside* the "ls -l" line */ 493 * does not appear *inside* the "ls -l" line */
494 lpath = NULL; 494 lpath = NULL;
495#if !ENABLE_PLATFORM_MINGW32
495 if (opt & OPT_l) 496 if (opt & OPT_l)
496 if (S_ISLNK(dn->dn_mode)) 497 if (S_ISLNK(dn->dn_mode))
497 lpath = xmalloc_readlink_or_warn(dn->fullname); 498 lpath = xmalloc_readlink_or_warn(dn->fullname);
499#endif
498 500
499 if (opt & OPT_i) /* show inode# */ 501 if (opt & OPT_i) /* show inode# */
500 column += printf("%7"LL_FMT"u ", (long long) dn->dn_ino); 502 column += printf("%7"LL_FMT"u ", (long long) dn->dn_ino);