diff options
-rw-r--r-- | psutil/_psutil_common.c | 2 | ||||
-rw-r--r-- | psutil/_psutil_osx.c | 2 | ||||
-rw-r--r-- | psutil/_psutil_windows.c | 2 | ||||
-rw-r--r-- | psutil/arch/osx/process_info.c | 2 | ||||
-rw-r--r-- | psutil/arch/windows/process_info.c | 3 |
5 files changed, 7 insertions, 4 deletions
diff --git a/psutil/_psutil_common.c b/psutil/_psutil_common.c index 2bf4ad79..fae8d970 100644 --- a/psutil/_psutil_common.c +++ b/psutil/_psutil_common.c @@ -106,7 +106,6 @@ NoSuchProcess(const char *syscall) { char msg[1024]; sprintf(msg, "assume no such process (originated from %s)", syscall); - psutil_debug(msg); exc = PyObject_CallFunction(PyExc_OSError, "(is)", ESRCH, msg); PyErr_SetObject(PyExc_OSError, exc); Py_XDECREF(exc); @@ -124,7 +123,6 @@ AccessDenied(const char *syscall) { char msg[1024]; sprintf(msg, "assume access denied (originated from %s)", syscall); - psutil_debug(msg); exc = PyObject_CallFunction(PyExc_OSError, "(is)", EACCES, msg); PyErr_SetObject(PyExc_OSError, exc); Py_XDECREF(exc); diff --git a/psutil/_psutil_osx.c b/psutil/_psutil_osx.c index 8df186cb..33d46635 100644 --- a/psutil/_psutil_osx.c +++ b/psutil/_psutil_osx.c @@ -97,7 +97,7 @@ psutil_task_for_pid(pid_t pid, mach_port_t *task) err = task_for_pid(mach_task_self(), pid, task); if (err != KERN_SUCCESS) { if (psutil_pid_exists(pid) == 0) - NoSuchProcess("task_for_pid -> psutil_pid_exists -> 0"); + NoSuchProcess("task_for_pid"); else if (psutil_is_zombie(pid) == 1) PyErr_SetString(ZombieProcessError, "task_for_pid -> psutil_is_zombie -> 1"); diff --git a/psutil/_psutil_windows.c b/psutil/_psutil_windows.c index 66177985..513d6c24 100644 --- a/psutil/_psutil_windows.c +++ b/psutil/_psutil_windows.c @@ -701,7 +701,7 @@ psutil_proc_threads(PyObject *self, PyObject *args) { if (pid == 0) { // raise AD instead of returning 0 as procexp is able to // retrieve useful information somehow - AccessDenied("automatically set for PID 0"); + AccessDenied("forced for PID 0"); goto error; } diff --git a/psutil/arch/osx/process_info.c b/psutil/arch/osx/process_info.c index eda60c38..fb9f24ff 100644 --- a/psutil/arch/osx/process_info.c +++ b/psutil/arch/osx/process_info.c @@ -131,11 +131,13 @@ psutil_sysctl_procargs(pid_t pid, char *procargs, size_t argmax) { // In case of zombie process we'll get EINVAL. We translate it // to NSP and _psosx.py will translate it to ZP. if (errno == EINVAL) { + psutil_debug("sysctl(KERN_PROCARGS2) -> EINVAL translated to NSP"); NoSuchProcess("sysctl(KERN_PROCARGS2) -> EINVAL"); return 1; } // There's nothing we can do other than raising AD. if (errno == EIO) { + psutil_debug("sysctl(KERN_PROCARGS2) -> EIO translated to AD"); AccessDenied("sysctl(KERN_PROCARGS2) -> EIO"); return 1; } diff --git a/psutil/arch/windows/process_info.c b/psutil/arch/windows/process_info.c index 80b38d6d..ac306536 100644 --- a/psutil/arch/windows/process_info.c +++ b/psutil/arch/windows/process_info.c @@ -56,6 +56,7 @@ psutil_convert_winerr(ULONG err, char* syscall) { if (err == ERROR_NOACCESS) { sprintf(fullmsg, "%s -> ERROR_NOACCESS", syscall); + psutil_debug(fullmsg); AccessDenied(fullmsg); } else { @@ -429,6 +430,8 @@ psutil_cmdline_query_proc(DWORD pid, WCHAR **pdata, SIZE_T *psize) { // https://github.com/giampaolo/psutil/issues/1501 if (status == STATUS_NOT_FOUND) { + psutil_debug("NtQueryInformationProcess(ProcessBasicInformation) -> " + "STATUS_NOT_FOUND turned into AD") AccessDenied("NtQueryInformationProcess(ProcessBasicInformation) -> " "STATUS_NOT_FOUND"); goto error; |