OSDN Git Service
(root)
/
android-x86
/
external-toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c55d30d
)
Fix tail -f /does/not/exist.
author
Elliott Hughes
<enh@google.com>
Sat, 9 Jan 2016 20:54:04 +0000
(12:54 -0800)
committer
Rob Landley
<rob@landley.net>
Mon, 11 Jan 2016 05:01:28 +0000
(23:01 -0600)
Exit immediately if we don't actually have anything to -f --- it's -f's
big brother -F that retries by name rather than by fd.
toys/posix/tail.c
patch
|
blob
|
history
diff --git
a/toys/posix/tail.c
b/toys/posix/tail.c
index
a00bfa0
..
d1c6250
100644
(file)
--- a/
toys/posix/tail.c
+++ b/
toys/posix/tail.c
@@
-245,7
+245,7
@@
void tail_main(void)
loopfiles_rw(args, O_RDONLY|(O_CLOEXEC*!(toys.optflags&FLAG_f)),
0, 0, do_tail);
- if (
toys.optflags & FLAG_f
) {
+ if (
(toys.optflags & FLAG_f) && TT.file_no
) {
int len, last_fd = TT.files[(TT.file_no-1)*2], i, fd;
struct inotify_event ev;