mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09: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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user