diff --git a/psutil/_psutil_common.c b/psutil/_psutil_common.c index e333c1624..5d025739f 100644 --- a/psutil/_psutil_common.c +++ b/psutil/_psutil_common.c @@ -70,7 +70,12 @@ psutil_pid_exists(long pid) { #endif } +#if defined(PSUTIL_OSX) + ret = kill((pid_t)pid , 0); +#else ret = kill(pid , 0); +#endif + if (ret == 0) return 1; else { diff --git a/psutil/_psutil_osx.c b/psutil/_psutil_osx.c index 160b02851..d1640714b 100644 --- a/psutil/_psutil_osx.c +++ b/psutil/_psutil_osx.c @@ -131,7 +131,6 @@ psutil_proc_name(PyObject *self, PyObject *args) { #else return Py_BuildValue("s", kp.kp_proc.p_comm); #endif - } @@ -895,7 +894,7 @@ static PyObject * psutil_disk_partitions(PyObject *self, PyObject *args) { int num; int i; - long len; + int len; uint64_t flags; char opts[400]; struct statfs *fs = NULL; diff --git a/psutil/arch/osx/process_info.c b/psutil/arch/osx/process_info.c index 49382c6ca..7b650c990 100644 --- a/psutil/arch/osx/process_info.c +++ b/psutil/arch/osx/process_info.c @@ -110,7 +110,7 @@ PyObject * psutil_get_cmdline(long pid) { int mib[3]; int nargs; - int len; + size_t len; char *procargs = NULL; char *arg_ptr; char *arg_end; diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py index 6cbfb98d5..7cf820cc8 100644 --- a/psutil/tests/__init__.py +++ b/psutil/tests/__init__.py @@ -494,8 +494,9 @@ def create_temp_file(suffix=None): c_code = textwrap.dedent( """ #include - void main() { + int main() { pause(); + return 1; } """) c_file = create_temp_file(suffix=".c")