From 12e070dd5f419947a3ce793a90ab661f7eb24684 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Mon, 5 Dec 2016 07:07:07 -0600 Subject: [PATCH] library: ensure 'namespace' types treated consistently Unlike the ps kludge under the master branch to ensure that namespaces appear the same under both 32 & 64-bit models, this newlib branch already used a proper type. However source data still carried the original type as 'signed long' versus that more proper 'unsigned long'. So, this patch makes sources & destinations identical. Reference(s): . master branch ps kludge commit c41c614b0c038d9374191f545259d9d70c451316 Signed-off-by: Jim Warner --- proc/namespace.c | 2 +- proc/namespace.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/proc/namespace.c b/proc/namespace.c index cd4f47d5..59079dab 100644 --- a/proc/namespace.c +++ b/proc/namespace.c @@ -103,7 +103,7 @@ PROCPS_EXPORT int procps_ns_read_pid( for (i=0; i < PROCPS_NS_COUNT; i++) { snprintf(path, NSPATHLEN, "/proc/%d/ns/%s", pid, ns_names[i]); if (0 == stat(path, &st)) - nsp->ns[i] = (long)st.st_ino; + nsp->ns[i] = (unsigned long)st.st_ino; else nsp->ns[i] = 0; } diff --git a/proc/namespace.h b/proc/namespace.h index 2aaea5c0..2885d8d5 100644 --- a/proc/namespace.h +++ b/proc/namespace.h @@ -36,7 +36,7 @@ enum namespace_type { }; struct procps_namespaces { - long ns[PROCPS_NS_COUNT]; + unsigned long ns[PROCPS_NS_COUNT]; }; const char *procps_ns_get_name(const int id);