]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Save errno after kill() fails, restore the saved errno after logging the error.
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:46 +0000 (11:23 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:46 +0000 (11:23 -0700)
open-vm-tools/lib/procMgr/procMgrPosix.c

index 686bc65fe8b58166c2f65ebb34a387b76e699edb..c6434378f33024ed6da922200ef805cb6d5d953c 100644 (file)
@@ -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;