[CRIU] [PATCH 2/7] compel/s390: Fix return value in error path

Rikard Falkeborn rikard.falkeborn at gmail.com
Sun Apr 28 21:22:50 MSK 2019


In a function with return type bool, returning a non-zero value is
interpreted as returning true. In the error paths we want to return
false to indicate failure. Change -1 to false to fix this.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn at gmail.com>
---
 compel/arch/s390/src/lib/infect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compel/arch/s390/src/lib/infect.c b/compel/arch/s390/src/lib/infect.c
index fcb463fa..00e9c36d 100644
--- a/compel/arch/s390/src/lib/infect.c
+++ b/compel/arch/s390/src/lib/infect.c
@@ -493,7 +493,7 @@ bool arch_can_dump_task(struct parasite_ctl *ctl)
 	if (psw->mask & PSW_MASK_RI) {
 		if (get_ri_cb(pid, &fpregs) < 0) {
 			pr_perror("Can't dump process with RI bit active");
-			return -1;
+			return false;
 		}
 	}
 	/* We don't support 24 and 31 bit mode - only 64 bit */
-- 
2.21.0



More information about the CRIU mailing list