summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2017-05-16 20:37:23 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2017-05-16 20:37:23 +0200
commit44d433db2de6c3834fbad79e0e657437c1bc7b99 (patch)
tree2292a27d96b19d8433047e7220762229ca82960f
parent7005b9310f155411c4d53c02c4701868c306964f (diff)
downloadpsutil-44d433db2de6c3834fbad79e0e657437c1bc7b99.tar.gz
win: fix C compiler warning
-rw-r--r--psutil/arch/windows/process_info.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/psutil/arch/windows/process_info.c b/psutil/arch/windows/process_info.c
index a871282c..13226b7c 100644
--- a/psutil/arch/windows/process_info.c
+++ b/psutil/arch/windows/process_info.c
@@ -93,7 +93,8 @@ psutil_get_pids(DWORD *numberOfReturnedPIDs) {
}
if (! EnumProcesses(procArray, procArrayByteSz, &enumReturnSz)) {
free(procArray);
- return PyErr_SetFromWindowsErr(0);
+ PyErr_SetFromWindowsErr(0);
+ return NULL;
}
} while (enumReturnSz == procArraySz * sizeof(DWORD));
@@ -137,7 +138,8 @@ psutil_pid_is_running(DWORD pid) {
// Be strict and raise an exception; the caller is supposed
// to take -1 into account.
else {
- return PyErr_SetFromWindowsErr(err);
+ PyErr_SetFromWindowsErr(err);
+ return -1;
}
}
@@ -154,8 +156,11 @@ psutil_pid_is_running(DWORD pid) {
// a process to deny access to.
if (err == ERROR_ACCESS_DENIED)
return 1;
- else
- return PyErr_SetFromWindowsErr(err);
+ else {
+ PyErr_SetFromWindowsErr(err);
+ return -1;
+ }
+
}
}