From 0068c53f7e134c455785df7b0547f553d6eb80dd Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 21 Mar 2018 14:06:02 -0500 Subject: Collate two error messages that both mean "your kernel is broken". --- toys/other/vmstat.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'toys') diff --git a/toys/other/vmstat.c b/toys/other/vmstat.c index a16afe65..4aa2144b 100644 --- a/toys/other/vmstat.c +++ b/toys/other/vmstat.c @@ -64,12 +64,9 @@ static void get_vmstat_proc(struct vmstat_proc *vmstat_proc) file = xreadfile(name = vmstuff[i], 0, 0); continue; - } else if (!(p = strafter(file, vmstuff[i]))) { - error_exit("No %sin %s", vmstuff[i], name); - } - if (1 != sscanf(p, "%"PRIu64"%n", new++, &j)) { - error_exit("Bad %sin %s: %s", vmstuff[i], name, p); - } + } else p = strafter(file, vmstuff[i]); + if (!p || 1!=sscanf(p, "%"PRIu64"%n", new++, &j)) + error_exit("Bad %sin %s", vmstuff[i], name); p += j; } free(file); -- cgit v1.2.3