Commit 1c1aaa33 authored by Vlastimil Babka's avatar Vlastimil Babka

Merge branch 'slab/for-6.2/tools' into slab/for-next

A patch for tools/vm/slabinfo to give more useful feedback when not run
as a root, by Rong Tao.
parents c64b95d3 654058e6
......@@ -157,9 +157,11 @@ static unsigned long read_obj(const char *name)
{
FILE *f = fopen(name, "r");
if (!f)
if (!f) {
buffer[0] = 0;
else {
if (errno == EACCES)
fatal("%s, Try using superuser\n", strerror(errno));
} else {
if (!fgets(buffer, sizeof(buffer), f))
buffer[0] = 0;
fclose(f);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment