Re: [libvirt PATCH 1/2] util: Fix error return for virProcessKillPainfullyDelay()

2023-09-25 Thread Ján Tomko

On a Friday in 2023, Jonathon Jongsma wrote:

Commit 93af79fb removed a cleanup label in favor of returning error
values directly in certain cases. But the final return value was changed
from -1 to 0. If we get to the end of the function, that means that
we've waited for the process to exit but it still exists. So we should
return -1. The error message was still being set correctly, but we were
returning a success status (0).

Signed-off-by: Jonathon Jongsma 
---
src/util/virprocess.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature


[libvirt PATCH 1/2] util: Fix error return for virProcessKillPainfullyDelay()

2023-09-22 Thread Jonathon Jongsma
Commit 93af79fb removed a cleanup label in favor of returning error
values directly in certain cases. But the final return value was changed
from -1 to 0. If we get to the end of the function, that means that
we've waited for the process to exit but it still exists. So we should
return -1. The error message was still being set correctly, but we were
returning a success status (0).

Signed-off-by: Jonathon Jongsma 
---
 src/util/virprocess.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index 31b833e5c8..6ce5ef99a9 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -436,7 +436,7 @@ virProcessKillPainfullyDelay(pid_t pid, bool force, 
unsigned int extradelay, boo
  _("Failed to terminate process %1$lld with SIG%2$s"),
  (long long)pid, signame);
 
-return 0;
+return -1;
 }
 
 
-- 
2.41.0