mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
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.
This commit is contained in:
commit
1c1aaa3319
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user