aboutsummaryrefslogtreecommitdiffstats
path: root/src/tail.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tail.c')
-rw-r--r--src/tail.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/tail.c b/src/tail.c
index ce3a3285b..753963937 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -39,6 +39,7 @@
#include "fcntl--.h"
#include "iopoll.h"
#include "isapipe.h"
+#include "issymlink.h"
#include "posixver.h"
#include "quote.h"
#include "stat-size.h"
@@ -976,8 +977,7 @@ recheck (struct File_spec *f, bool blocking)
affirm (valid_file_spec (f));
- char linkbuf[1];
- if (! disable_inotify && 0 <= readlink (f->name, linkbuf, 1))
+ if (! disable_inotify && issymlink (f->name) == 1)
{
/* Diagnose the edge case where a regular file is changed
to a symlink. We avoid inotify with symlinks since
@@ -1350,9 +1350,8 @@ any_non_remote_file (const struct File_spec *f, int n_files)
static bool
any_symlinks (const struct File_spec *f, int n_files)
{
- char linkbuf[1];
for (int i = 0; i < n_files; i++)
- if (0 <= readlink (f[i].name, linkbuf, 1))
+ if (issymlink (f[i].name) == 1)
return true;
return false;
}