]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: fix success return for virProcessKillPainfullyDelay()
authorJonathon Jongsma <jjongsma@redhat.com>
Fri, 22 Sep 2023 19:42:42 +0000 (14:42 -0500)
committerJonathon Jongsma <jjongsma@redhat.com>
Mon, 2 Oct 2023 13:52:03 +0000 (08:52 -0500)
commit85e893a836f59ee7cffdd86bfbb04c714433d0aa
tree6bc11e40e96eb48bc46bec7ad7ffca38ef72a6fa
parent67e3164ecd09104c04f7a4940fc667d22cad0e92
util: fix success return for virProcessKillPainfullyDelay()

virProcessKillPainfullyDelay() currently almost always returns 1 or -1,
even though the documentation indicates that it should return 0 if the
process was terminated gracefully. But the computation of the return
code is faulty and the only case where it currently returns 0 is when it
is called with the pid of a process that does not exist.

Since no callers ever even distinguish between the 0 and 1 response
codes, simply get rid of the distinction and return 0 for both cases.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virprocess.c