diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2019-01-25 16:36:17 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2019-01-25 16:36:17 +0100 |
commit | 6f4a6228998df48ee09413377785d13d2eec7998 (patch) | |
tree | 1be8f60da39a21d5be40bdccff1512a3044dc3c0 /psutil/_psutil_linux.c | |
parent | c6b3e929deb182d4db6007548571ad8ddb32bd87 (diff) | |
download | psutil-6f4a6228998df48ee09413377785d13d2eec7998.tar.gz |
#1394 / windows / process exe(): convert errno 0 into ERROR_ACCESS_DENIED; errno 0 occurs when the Python process runs in 'Virtual Secure Mode'
Diffstat (limited to 'psutil/_psutil_linux.c')
-rw-r--r-- | psutil/_psutil_linux.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/psutil/_psutil_linux.c b/psutil/_psutil_linux.c index bd27b5f9..5b7a56ad 100644 --- a/psutil/_psutil_linux.c +++ b/psutil/_psutil_linux.c @@ -211,6 +211,7 @@ psutil_disk_partitions(PyObject *self, PyObject *args) { file = setmntent(mtab_path, "r"); Py_END_ALLOW_THREADS if ((file == 0) || (file == NULL)) { + psutil_debug("setmntent() failed"); PyErr_SetFromErrnoWithFilename(PyExc_OSError, mtab_path); goto error; } @@ -298,8 +299,10 @@ psutil_proc_cpu_affinity_get(PyObject *self, PyObject *args) { while (1) { setsize = CPU_ALLOC_SIZE(ncpus); mask = CPU_ALLOC(ncpus); - if (mask == NULL) + if (mask == NULL) { + psutil_debug("CPU_ALLOC() failed"); return PyErr_NoMemory(); + } if (sched_getaffinity(pid, setsize, mask) == 0) break; CPU_FREE(mask); |