Skip to content

Commit

Permalink
#916: [OSX] fix many compilation warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Oct 12, 2016
1 parent 79356b3 commit 16a5ee7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions psutil/_psutil_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions psutil/_psutil_osx.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ psutil_proc_name(PyObject *self, PyObject *args) {
#else
return Py_BuildValue("s", kp.kp_proc.p_comm);
#endif

}


Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion psutil/arch/osx/process_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion psutil/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,9 @@ def create_temp_file(suffix=None):
c_code = textwrap.dedent(
"""
#include <unistd.h>
void main() {
int main() {
pause();
return 1;
}
""")
c_file = create_temp_file(suffix=".c")
Expand Down

0 comments on commit 16a5ee7

Please sign in to comment.