posixshmcontrol(1): silently ignore inaccessible segments when listing

PR:	271038
Reported by:	rau8344@gmail.com
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2023-04-24 02:30:58 +03:00
parent e51be73a60
commit 043e24bdb0

View File

@ -308,8 +308,10 @@ list_shm(int argc, char **argv)
continue;
fd = shm_open(kif->kf_path, O_RDONLY, 0);
if (fd == -1) {
warn("open %s", kif->kf_path);
ret = 1;
if (errno != EACCES) {
warn("open %s", kif->kf_path);
ret = 1;
}
continue;
}
error = fstat(fd, &st);