summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2017-05-30 12:18:53 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2017-05-30 12:18:53 +0200
commit42bebc2ffdb874791b19b0362bad8c60120313ac (patch)
treef0c832d8a300c9f6e4ec155b73914ec0d8fa4606
parentee28b7e730b6c65314815029e225c529be5cc835 (diff)
downloadpsutil-42bebc2ffdb874791b19b0362bad8c60120313ac.tar.gz
fix C compiler warnings
-rw-r--r--psutil/_psutil_windows.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/psutil/_psutil_windows.c b/psutil/_psutil_windows.c
index 7c247975..42c9e4e0 100644
--- a/psutil/_psutil_windows.c
+++ b/psutil/_psutil_windows.c
@@ -465,9 +465,7 @@ static PyObject *
psutil_proc_create_time(PyObject *self, PyObject *args) {
long pid;
long long unix_time;
- DWORD exitCode;
HANDLE hProcess;
- BOOL ret;
FILETIME ftCreate, ftExit, ftKernel, ftUser;
if (! PyArg_ParseTuple(args, "l", &pid))
@@ -492,7 +490,9 @@ psutil_proc_create_time(PyObject *self, PyObject *args) {
}
}
-/*
+ CloseHandle(hProcess);
+
+ /*
// Make sure the process is not gone as OpenProcess alone seems to be
// unreliable in doing so (it seems a previous call to p.wait() makes
// it unreliable).
@@ -510,7 +510,8 @@ psutil_proc_create_time(PyObject *self, PyObject *args) {
if (GetLastError() != ERROR_ACCESS_DENIED)
return PyErr_SetFromWindowsErr(0);
}
-*/
+ */
+
// Convert the FILETIME structure to a Unix time.
// It's the best I could find by googling and borrowing code here
// and there. The time returned has a precision of 1 second.