[lvm-devel] [PATCH] scripts: generator-internals: Fix return value

Rikard Falkeborn rikard.falkeborn at gmail.com
Sat May 11 23:19:52 UTC 2019


Returning -1 from a function with bool as return type is the same as
returning true. Change to false to indicate failure if there is an error
in the child.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn at gmail.com>
---
 scripts/generator-internals.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/generator-internals.c b/scripts/generator-internals.c
index 733e8189c..c39c35324 100644
--- a/scripts/generator-internals.c
+++ b/scripts/generator-internals.c
@@ -101,7 +101,7 @@ static bool _close_child(struct child_process *child)
 
 	while (waitpid(child->pid, &status, 0) < 0)
 		if (errno != EINTR)
-			return -1;
+			return false;
 
 	if (WIFEXITED(status) && !WEXITSTATUS(status))
 		return true;
-- 
2.21.0




More information about the lvm-devel mailing list