diff options
Diffstat (limited to 'psutil/_psutil_bsd.c')
-rw-r--r-- | psutil/_psutil_bsd.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/psutil/_psutil_bsd.c b/psutil/_psutil_bsd.c index 20f24ce9..953fcd08 100644 --- a/psutil/_psutil_bsd.c +++ b/psutil/_psutil_bsd.c @@ -125,18 +125,8 @@ psutil_pids(PyObject *self, PyObject *args) { if (py_retlist == NULL) return NULL; - // TODO: RuntimeError is inappropriate here; we could return the - // original error instead. - if (psutil_get_proc_list(&proclist, &num_processes) != 0) { - if (errno != 0) { - PyErr_SetFromErrno(PyExc_OSError); - } - else { - PyErr_SetString(PyExc_RuntimeError, - "failed to retrieve process list"); - } + if (psutil_get_proc_list(&proclist, &num_processes) != 0) goto error; - } if (num_processes > 0) { orig_address = proclist; // save so we can free it after we're done @@ -485,7 +475,9 @@ psutil_proc_open_files(PyObject *self, PyObject *args) { errno = 0; freep = kinfo_getfile(pid, &cnt); if (freep == NULL) { +#if !defined(PSUTIL_OPENBSD) psutil_raise_for_pid(pid, "kinfo_getfile()"); +#endif goto error; } |