[RFC PATCH v3 09/14] [squash] pidns.c: print less error message

Ákos Uzonyi uzonyi.akos at gmail.com
Sat Jun 13 11:25:31 UTC 2020


---
 pidns.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/pidns.c b/pidns.c
index 7561ed77..cf127711 100644
--- a/pidns.c
+++ b/pidns.c
@@ -170,10 +170,8 @@ get_ns_hierarchy(int proc_pid, uint64_t *ns_buf, size_t ns_buf_size)
 		return 0;
 
 	fd = open(path, O_RDONLY | O_NONBLOCK);
-	if (fd < 0) {
-		perror_msg("get_ns_hierarchy: opening /proc/<pid>/ns/pid");
+	if (fd < 0)
 		return 0;
-	}
 
 	while (1) {
 		ret = fstat(fd, &st);
@@ -255,10 +253,8 @@ get_id_list(int proc_pid, int *id_buf, enum pid_type type)
 		return 0;
 
 	f = fopen(buf, "r");
-	if (!f) {
-		perror_msg("get_id_list: opening /proc/<pid>/status");
+	if (!f)
 		return 0;
-	}
 
 	free(buf);
 	buf = NULL;
-- 
2.27.0



More information about the Strace-devel mailing list