Skip to content

Commit

Permalink
sunos: fix C compiler warning
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed May 18, 2017
1 parent 0159ddd commit a6eff81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions psutil/_psutil_sunos.c
Expand Up @@ -183,7 +183,7 @@ psutil_proc_cpu_times(PyObject *self, PyObject *args) {
*/
static PyObject *
psutil_proc_cpu_num(PyObject *self, PyObject *args) {
int fd = NULL;
int fd = -1;
int pid;
char path[1000];
struct prheader header;
Expand Down Expand Up @@ -248,7 +248,7 @@ psutil_proc_cpu_num(PyObject *self, PyObject *args) {
return Py_BuildValue("i", proc_num);

error:
if (fd != NULL)
if (fd != -1)
close(fd);
if (ptr != NULL)
free(ptr);
Expand Down

0 comments on commit a6eff81

Please sign in to comment.