diff options
Diffstat (limited to 'psutil/arch/netbsd/proc.c')
-rw-r--r-- | psutil/arch/netbsd/proc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/psutil/arch/netbsd/proc.c b/psutil/arch/netbsd/proc.c index e71afb38..2688dced 100644 --- a/psutil/arch/netbsd/proc.c +++ b/psutil/arch/netbsd/proc.c @@ -115,10 +115,13 @@ psutil_proc_cwd(PyObject *self, PyObject *args) { ssize_t len = readlink(buf, path, sizeof(path) - 1); free(buf); if (len == -1) { - if (errno == ENOENT) - NoSuchProcess("readlink -> ENOENT"); - else + if (errno == ENOENT) { + psutil_debug("sysctl(KERN_PROC_CWD) -> ENOENT converted to ''"); + return Py_BuildValue("", ""); + } + else { PyErr_SetFromErrno(PyExc_OSError); + } return NULL; } path[len] = '\0'; |