Blame SOURCES/numactl-2.0.12-numastat-when-reading-no-exist-pid-return-EXIT_FAILU.patch
|
|
b18e0c |
From 0707807bad2106598d5a73e0adec7ae3c3de284f Mon Sep 17 00:00:00 2001
|
|
|
b18e0c |
From: Pingfan Liu <piliu@redhat.com>
|
|
|
b18e0c |
Date: Tue, 21 May 2019 14:13:28 +0800
|
|
|
b18e0c |
Subject: [PATCH] numastat: when reading no-exist pid, return EXIT_FAILURE
|
|
|
b18e0c |
|
|
|
b18e0c |
This ease the result query by $?
|
|
|
b18e0c |
|
|
|
b18e0c |
Signed-off-by: Pingfan Liu <piliu@redhat.com>
|
|
|
b18e0c |
---
|
|
|
b18e0c |
numastat.c | 3 +++
|
|
|
b18e0c |
1 file changed, 3 insertions(+)
|
|
|
b18e0c |
|
|
|
b18e0c |
diff --git a/numastat.c b/numastat.c
|
|
|
b18e0c |
index 263bddf..f1a3cc1 100644
|
|
|
b18e0c |
--- a/numastat.c
|
|
|
b18e0c |
+++ b/numastat.c
|
|
|
b18e0c |
@@ -956,6 +956,8 @@ void show_process_info() {
|
|
|
b18e0c |
if (!fs) {
|
|
|
b18e0c |
sprintf(buf, "Can't read /proc/%d/numa_maps", pid);
|
|
|
b18e0c |
perror(buf);
|
|
|
b18e0c |
+ if (num_pids == 1)
|
|
|
b18e0c |
+ exit(EXIT_FAILURE);
|
|
|
b18e0c |
continue;
|
|
|
b18e0c |
}
|
|
|
b18e0c |
// Add up sub-category memory used from each node. Must go line by line
|
|
|
b18e0c |
@@ -1023,6 +1025,7 @@ void show_process_info() {
|
|
|
b18e0c |
if (ferror(fs)) {
|
|
|
b18e0c |
sprintf(buf, "Can't read /proc/%d/numa_maps", pid);
|
|
|
b18e0c |
perror(buf);
|
|
|
b18e0c |
+ exit(EXIT_FAILURE);
|
|
|
b18e0c |
}
|
|
|
b18e0c |
fclose(fs);
|
|
|
b18e0c |
// If showing individual tables, or we just added the last total line,
|
|
|
b18e0c |
--
|
|
|
b18e0c |
2.7.5
|
|
|
b18e0c |
|