From: Oliver Kurth Date: Fri, 15 Sep 2017 18:23:46 +0000 (-0700) Subject: Save errno after kill() fails, restore the saved errno after logging the error. X-Git-Tag: stable-10.2.0~141 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=211e99aad3da1a9c755e30bf4cf02667ff5480c4;p=thirdparty%2Fopen-vm-tools.git Save errno after kill() fails, restore the saved errno after logging the error. --- diff --git a/open-vm-tools/lib/procMgr/procMgrPosix.c b/open-vm-tools/lib/procMgr/procMgrPosix.c index 686bc65fe..c6434378f 100644 --- a/open-vm-tools/lib/procMgr/procMgrPosix.c +++ b/open-vm-tools/lib/procMgr/procMgrPosix.c @@ -1816,8 +1816,10 @@ ProcMgrKill(pid_t pid, // IN int timeout) // IN: -1 will wait indefinitely { if (kill(pid, sig) == -1) { + int savedErrno = errno; Warning("Error trying to kill process %"FMTPID" with signal %d: %s\n", pid, sig, Msg_ErrString()); + errno = savedErrno; return 0; } else { int i;