From 7beabc8e917d31a3cc10b0a97d38d887fff92b6b Mon Sep 17 00:00:00 2001 From: Fabian Dellwing Date: Tue, 13 Feb 2024 19:57:28 +0100 Subject: [PATCH] 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. --- Userland/Utilities/tail.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Utilities/tail.cpp b/Userland/Utilities/tail.cpp index 228d6a4d51..e4084447f8 100644 --- a/Userland/Utilities/tail.cpp +++ b/Userland/Utilities/tail.cpp @@ -62,7 +62,7 @@ ErrorOr 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