summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ls.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ls.c b/src/ls.c
index aeaf4c7b9..420552ee0 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -2141,6 +2141,12 @@ get_link_name (const char *filename, struct fileinfo *f)
size_t link_val_len;
f->linkname = xreadlink (filename, &link_val_len);
+ if (f->linkname == NULL)
+ {
+ error (0, errno, _("cannot read symbolic link %s"),
+ quotearg_colon (filename));
+ exit_status = 1;
+ }
}
/* If `linkname' is a relative path and `path' contains one or more