Fix handling of /proc/cpuinfo for non x86 architectures

Not all architectures include lines with "vendor_id\t" or
"processor\t". ARM Linux without SMP support includes
neither of these two entries. With SMP support, there are
"processor\t" entries for each CPU.

Set vendor to an empty string initially, so there is a default value.

Assume CPU id 0 when no number was set while encountering the first
"bogomips\t" line. If there are more such lines without a correct
number, only the first CPU is handled. This should not be needed
for ARM, but makes the code more robust because it avoids calling
handle_one_cpu twice with number == 0.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
1 file changed