diff options
| -rw-r--r-- | Makefile | 3 | ||||
| -rw-r--r-- | psutil/_psutil_osx.c | 13 | ||||
| -rw-r--r-- | psutil/arch/osx/process_info.c | 4 | ||||
| -rw-r--r-- | psutil/arch/osx/process_info.h | 2 |
4 files changed, 12 insertions, 10 deletions
@@ -4,6 +4,7 @@ PYTHON = python TSCRIPT = psutil/tests/runner.py +ARGS = # List of nice-to-have dev libs. DEPS = argparse \ @@ -139,7 +140,7 @@ test-platform: install # Run a specific test by name, e.g. # make test-by-name psutil.tests.test_system.TestSystemAPIs.test_cpu_times test-by-name: install - @$(PYTHON) -m unittest -v $(filter-out $@,$(MAKECMDGOALS)) + @$(PYTHON) -m unittest -v $(ARGS) coverage: install # Note: coverage options are controlled by .coveragerc file diff --git a/psutil/_psutil_osx.c b/psutil/_psutil_osx.c index bdd7c559..cf9eda6d 100644 --- a/psutil/_psutil_osx.c +++ b/psutil/_psutil_osx.c @@ -813,11 +813,12 @@ psutil_cpu_times(PyObject *self, PyObject *args) { static PyObject * psutil_per_cpu_times(PyObject *self, PyObject *args) { natural_t cpu_count; + natural_t i; processor_info_array_t info_array; mach_msg_type_number_t info_count; kern_return_t error; processor_cpu_load_info_data_t *cpu_load_info = NULL; - int i, ret; + int ret; PyObject *py_retlist = PyList_New(0); PyObject *py_cputime = NULL; @@ -1036,7 +1037,7 @@ psutil_proc_status(PyObject *self, PyObject *args) { static PyObject * psutil_proc_threads(PyObject *self, PyObject *args) { long pid; - int err, j, ret; + int err, ret; kern_return_t kr; unsigned int info_count = TASK_BASIC_INFO_COUNT; mach_port_t task = MACH_PORT_NULL; @@ -1044,7 +1045,7 @@ psutil_proc_threads(PyObject *self, PyObject *args) { thread_act_port_array_t thread_list = NULL; thread_info_data_t thinfo_basic; thread_basic_info_t basic_info_th; - mach_msg_type_number_t thread_count, thread_info_count; + mach_msg_type_number_t thread_count, thread_info_count, j; PyObject *py_tuple = NULL; PyObject *py_retlist = PyList_New(0); @@ -1146,10 +1147,10 @@ error: static PyObject * psutil_proc_open_files(PyObject *self, PyObject *args) { long pid; - int pidinfo_result; + unsigned long pidinfo_result; int iterations; int i; - int nb; + unsigned long nb; struct proc_fdinfo *fds_pointer = NULL; struct proc_fdinfo *fdp_pointer; @@ -1257,7 +1258,7 @@ psutil_proc_connections(PyObject *self, PyObject *args) { int pidinfo_result; int iterations; int i; - int nb; + unsigned long nb; struct proc_fdinfo *fds_pointer = NULL; struct proc_fdinfo *fdp_pointer; diff --git a/psutil/arch/osx/process_info.c b/psutil/arch/osx/process_info.c index 7b650c99..9e6dc1ce 100644 --- a/psutil/arch/osx/process_info.c +++ b/psutil/arch/osx/process_info.c @@ -356,10 +356,10 @@ psutil_get_kinfo_proc(long pid, struct kinfo_proc *kp) { * A wrapper around proc_pidinfo(). * Returns 0 on failure (and Python exception gets already set). */ -int +unsigned long psutil_proc_pidinfo(long pid, int flavor, uint64_t arg, void *pti, int size) { errno = 0; - int ret = proc_pidinfo((int)pid, flavor, arg, pti, size); + unsigned long ret = proc_pidinfo((int)pid, flavor, arg, pti, size); if ((ret <= 0) || (ret < sizeof(pti))) { psutil_raise_for_pid(pid, "proc_pidinfo() syscall failed"); return 0; diff --git a/psutil/arch/osx/process_info.h b/psutil/arch/osx/process_info.h index bd2eef86..83fa1231 100644 --- a/psutil/arch/osx/process_info.h +++ b/psutil/arch/osx/process_info.h @@ -11,7 +11,7 @@ typedef struct kinfo_proc kinfo_proc; int psutil_get_argmax(void); int psutil_get_kinfo_proc(long pid, struct kinfo_proc *kp); int psutil_get_proc_list(kinfo_proc **procList, size_t *procCount); -int psutil_proc_pidinfo( +unsigned long psutil_proc_pidinfo( long pid, int flavor, uint64_t arg, void *pti, int size); PyObject* psutil_get_cmdline(long pid); PyObject* psutil_get_environ(long pid); |
