summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakao Indoh <indou.takao@jp.fujitsu.com>2014-06-05 14:10:55 +0900
committerSimon Horman <horms@verge.net.au>2014-06-05 18:07:21 +0900
commit272ceb535415437041f989278635ac8de729cd6b (patch)
tree3fe092098a9d808037f0957340a0f048341f593b
parent08484c97ecce7df2ded8079c6478a58262007acc (diff)
downloadkexec-tools-272ceb535415437041f989278635ac8de729cd6b.tar.gz
Fix mistaken check of stat(2) return value
get_crash_notes_per_cpu() should return -1 if return value of stat(2) is zero (on success). Signed-off-by: Takao Indoh <indou.takao@jp.fujitsu.com> Reviewed-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Acked-by: WANG Chao <chaowang@redhat.com> Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--kexec/crashdump.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kexec/crashdump.c b/kexec/crashdump.c
index 131e624..15c1105 100644
--- a/kexec/crashdump.c
+++ b/kexec/crashdump.c
@@ -84,7 +84,7 @@ int get_crash_notes_per_cpu(int cpu, uint64_t *addr, uint64_t *len)
if (fopen_errno != ENOENT)
die("Could not open \"%s\": %s\n", crash_notes,
strerror(fopen_errno));
- if (!stat("/sys/devices", &cpu_stat)) {
+ if (stat("/sys/devices", &cpu_stat)) {
stat_errno = errno;
if (stat_errno == ENOENT)
die("\"/sys/devices\" does not exist. "