diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2017-05-16 17:40:48 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2017-05-16 17:40:48 +0200 |
commit | 96e1881c535dc7518cb4dc211a0c26aee5ad2b1c (patch) | |
tree | b5250b43a235d06e58da68ce078a551c80932d43 | |
parent | 59749a716a18678a8296ce346652cf9bc8f75842 (diff) | |
download | psutil-96e1881c535dc7518cb4dc211a0c26aee5ad2b1c.tar.gz |
declare PSUTIL_CONN_NONE as a static shared constant
-rw-r--r-- | psutil/_psutil_common.h | 3 | ||||
-rw-r--r-- | psutil/_psutil_osx.c | 3 | ||||
-rw-r--r-- | psutil/_psutil_sunos.c | 2 | ||||
-rw-r--r-- | psutil/_psutil_windows.c | 3 | ||||
-rw-r--r-- | psutil/arch/freebsd/proc_socks.c | 4 | ||||
-rw-r--r-- | psutil/arch/freebsd/sys_socks.c | 2 | ||||
-rw-r--r-- | psutil/arch/netbsd/socks.c | 2 | ||||
-rw-r--r-- | psutil/arch/openbsd/specific.c | 3 |
8 files changed, 3 insertions, 19 deletions
diff --git a/psutil/_psutil_common.h b/psutil/_psutil_common.h index 0507458a..aa634ad3 100644 --- a/psutil/_psutil_common.h +++ b/psutil/_psutil_common.h @@ -6,6 +6,9 @@ #include <Python.h> +// a signaler for connections without an actual status +static const int PSUTIL_CONN_NONE = 128; + PyObject* AccessDenied(void); PyObject* NoSuchProcess(void); #if PY_MAJOR_VERSION < 3 diff --git a/psutil/_psutil_osx.c b/psutil/_psutil_osx.c index a831441a..20ece694 100644 --- a/psutil/_psutil_osx.c +++ b/psutil/_psutil_osx.c @@ -1184,9 +1184,6 @@ error: } -// a signaler for connections without an actual status -static int PSUTIL_CONN_NONE = 128; - /* * Return process TCP and UDP connections as a list of tuples. * References: diff --git a/psutil/_psutil_sunos.c b/psutil/_psutil_sunos.c index 422d48c7..6c152eed 100644 --- a/psutil/_psutil_sunos.c +++ b/psutil/_psutil_sunos.c @@ -49,8 +49,6 @@ #ifndef EXPER_IP_AND_ALL_IRES #define EXPER_IP_AND_ALL_IRES (1024+4) #endif -// a signaler for connections without an actual status -static int PSUTIL_CONN_NONE = 128; /* diff --git a/psutil/_psutil_windows.c b/psutil/_psutil_windows.c index a3e921c0..2772cab3 100644 --- a/psutil/_psutil_windows.c +++ b/psutil/_psutil_windows.c @@ -48,9 +48,6 @@ * ============================================================================ */ - // a flag for connections without an actual status -static int PSUTIL_CONN_NONE = 128; - #define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x)) #define FREE(x) HeapFree(GetProcessHeap(), 0, (x)) #define LO_T ((float)1e-7) diff --git a/psutil/arch/freebsd/proc_socks.c b/psutil/arch/freebsd/proc_socks.c index de4142be..9b03e059 100644 --- a/psutil/arch/freebsd/proc_socks.c +++ b/psutil/arch/freebsd/proc_socks.c @@ -22,10 +22,6 @@ #include "../../_psutil_posix.h" -// a signaler for connections without an actual status -static int PSUTIL_CONN_NONE = 128; - - // The tcplist fetching and walking is borrowed from netstat/inet.c. static char * psutil_fetch_tcplist(void) { diff --git a/psutil/arch/freebsd/sys_socks.c b/psutil/arch/freebsd/sys_socks.c index 4104c27d..3387838e 100644 --- a/psutil/arch/freebsd/sys_socks.c +++ b/psutil/arch/freebsd/sys_socks.c @@ -25,8 +25,6 @@ #include "../../_psutil_common.h" #include "../../_psutil_posix.h" -// a signaler for connections without an actual status -static int PSUTIL_CONN_NONE = 128; static struct xfile *psutil_xfiles; static int psutil_nxfiles; diff --git a/psutil/arch/netbsd/socks.c b/psutil/arch/netbsd/socks.c index bd260ad3..f370f094 100644 --- a/psutil/arch/netbsd/socks.c +++ b/psutil/arch/netbsd/socks.c @@ -24,8 +24,6 @@ #include "../../_psutil_common.h" #include "../../_psutil_posix.h" -// a signaler for connections without an actual status -int PSUTIL_CONN_NONE = 128; // address family filter enum af_filter { diff --git a/psutil/arch/openbsd/specific.c b/psutil/arch/openbsd/specific.c index 4caf6ed5..de30c4d7 100644 --- a/psutil/arch/openbsd/specific.c +++ b/psutil/arch/openbsd/specific.c @@ -41,9 +41,6 @@ #define PSUTIL_KPT2DOUBLE(t) (t ## _sec + t ## _usec / 1000000.0) // #define PSUTIL_TV2DOUBLE(t) ((t).tv_sec + (t).tv_usec / 1000000.0) -// a signaler for connections without an actual status -int PSUTIL_CONN_NONE = 128; - // ============================================================================ // Utility functions |