[PATCH 2/2] Fix mistaken check of stat(2) return value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 at jp.fujitsu.com>
---
 kexec/crashdump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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. "
-- 
1.9.3





[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux