mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 08:28:11 +00:00
tail: Use File::seek()
to determine seekability
Some change in the past made `File::tell()` not return an error if a file is not seekable. So instead do a real seek to check.
This commit is contained in:
parent
d375b5c2a5
commit
7beabc8e91
1 changed files with 1 additions and 1 deletions
|
@ -62,7 +62,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
if (!follow)
|
||||
TRY(Core::System::pledge("stdio"));
|
||||
|
||||
auto file_is_seekable = !f->tell().is_error();
|
||||
auto file_is_seekable = !f->seek(0, SeekMode::SetPosition).is_error();
|
||||
if (!file_is_seekable) {
|
||||
do {
|
||||
// FIXME: If f is the standard input, f->read_all() does not block
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue