Age | Commit message (Collapse) | Author |
|
fstat() doesn't fail on stdin, so check for fd 0 explicitly so we don't
try to access zero length array when optc was zero. (Plus can't reopen '-'.)
|
|
new lib/ flag), allow -s to be fraction of a second, inline (anonymous)
struct so globals.h isn't using an incomplete type, blank line in
GLOBALS() between option args and other variables, collate
tail_continue() to one function, add test.
|
|
(Based on someone else's patch.)
Implementing -F with inotify is a lot more work (including more
portability shims for macOS), so this is a simpler polling
implementation.
Also fix my earlier mistake where xnotify_add() wasn't actually an 'x'
function that exits on failure.
|
|
|
|
Yeah, it's twice the size and two codepaths, but seekable is the common
case, it won't work in pipelines without a non-seek codepath, and the
performance penalty not using seek on large files is a enormous.
|
|
into a structure passed as arguments, add x prefix to functions that can fail,
add overflow test.
|
|
Factor out the inotify code and add a kqueue equivalent.
Specifically tested on macOS 10.14, but I assume this works for other
BSDs too, given that I worked from the FreeBSD man page...
|
|
|
|
Be consistent about upper versus lower case. (Upper seems to have the
majority, so I went with that, though I'm happy to provide the opposite
patch as long as we're consistent!)
Be consistent about using \t. (Though saving a few bytes seems like it
might be better done in the code that generates help.h rather than
directly in the source, since tabs make careful ASCII art layout hard
enough that we regularly have things misaligned.)
Remove trailing periods (most of which seem to have been added by me).
Always use the US "human readable" rather than my British
"human-readable", and be more consistent about declaring whether we're
showing multiples of 1000 or 1024.
Just say "verbose" rather than adding a useless "mode" or "output".
|
|
|
|
|
|
|
|
This time with a test.
|
|
|
|
TT.file_no was being incorrectly calculated as 0 when tail -f was passed
a single argument.
|
|
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.
|
|
|
|
|
|
|
|
confusing update-alternatives, the paths of the links installed by toybox should
match those installed by busybox. This is accomplished by changing the flags
of a few tools within toybox.
|
|
|
|
Once we've read through the initial TT.bytes backlog we discard the extra data,
meaning we adjust the remaining amount each time so the overflow is zero bytes.
We were doing the adjustment right, but not zeroing out the overflow counter
after we did so.
|
|
|
|
(Still no -f support yet.)
|
|
- Rewrite most of the not lseek() logic
- Change meaning of len in line_list
- Use single instead of double linked list
|
|
|
|
right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
The actual code should be the same afterward, this is just cosmetic refactoring.
|
|
FOR_commandname before #including toys.h to trigger it. Rename DEFINE_GLOBALS() to just GLOBALS() (because I could never remember if it was DECLARE_GLOBALS). Convert existing commands to use new infrastructure, and replace optflag constants with FLAG_ macros where appropriate.
|
|
|
|
|