From: Tobias Stoeckmann Date: Sun, 12 Apr 2026 11:22:13 +0000 (+0200) Subject: irqtop/lsirq: Handle EOF in get_irqinfo X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=2e3b07d28b2843c2d6b0c4d91e3e2e7aa607f27c;p=thirdparty%2Futil-linux.git irqtop/lsirq: Handle EOF in get_irqinfo If an empty file is passed to get_irqinfo, getline fails without setting errno because EOF is not an error condition, even though -1 is returned. Suppress error message but keep the regular error handling. Signed-off-by: Tobias Stoeckmann --- diff --git a/sys-utils/irq-common.c b/sys-utils/irq-common.c index 4efe19277..37f839b44 100644 --- a/sys-utils/irq-common.c +++ b/sys-utils/irq-common.c @@ -257,7 +257,8 @@ static struct irq_stat *get_irqinfo(const char *input_file, int softirq, /* read header firstly */ if (getline(&line, &len, irqfile) < 0) { - warn(_("cannot read %s"), input_file); + if (!feof(irqfile)) + warn(_("cannot read %s"), input_file); goto close_file; }