Skip to content

Commit

Permalink
fix some C compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Jun 12, 2015
1 parent 1f575e3 commit b28c702
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
13 changes: 6 additions & 7 deletions psutil/arch/bsd/freebsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#include <libutil.h> // process open files, shared libs (kinfo_getvmmap), cwd
#include <sys/cpuset.h>


#include "freebsd.h"
#include "../../_psutil_common.h"


#define TV2DOUBLE(t) ((t).tv_sec + (t).tv_usec / 1000000.0)
Expand Down Expand Up @@ -67,7 +67,7 @@ psutil_kinfo_proc(const pid_t pid, struct kinfo_proc *proc) {
}


void
int
psutil_raise_ad_or_nsp(long pid) {
// Set exception to AccessDenied if pid exists else NoSuchProcess.
int ret;
Expand All @@ -76,19 +76,18 @@ psutil_raise_ad_or_nsp(long pid) {
NoSuchProcess();
else if (ret == 1)
AccessDenied();
else
return NULL;
return ret;
}


// remove spaces from string
void psutil_remove_spaces(char *str) {
static void psutil_remove_spaces(char *str) {
char *p1 = str;
char *p2 = str;
do
while (*p2 == ' ')
p2++;
while (*p1++ = *p2++);
while ((*p1++ = *p2++));
}


Expand Down Expand Up @@ -194,7 +193,7 @@ psutil_get_proc_list(struct kinfo_proc **procList, size_t *procCount) {
* -1 for failure (Exception raised);
* 1 for insufficient privileges.
*/
char
static char
*psutil_get_cmd_args(long pid, size_t *argsize) {
int mib[4], argmax;
size_t size = sizeof(argmax);
Expand Down
2 changes: 1 addition & 1 deletion psutil/arch/bsd/freebsd.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

typedef struct kinfo_proc kinfo_proc;

char *psutil_get_cmd_args(long pid, size_t *argsize);
static char *psutil_get_cmd_args(long pid, size_t *argsize);
int psutil_get_proc_list(struct kinfo_proc **procList, size_t *procCount);
int psutil_kinfo_proc(const pid_t pid, struct kinfo_proc *proc);
int psutil_pid_exists(long pid);
Expand Down
1 change: 1 addition & 0 deletions psutil/arch/bsd/freebsd_socks.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <net/if_media.h>
#include <libutil.h>

#include "freebsd.h"
#include "freebsd_socks.h"


Expand Down

0 comments on commit b28c702

Please sign in to comment.