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 c41c614b0c

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2016-12-05 07:07:07 -06:00 committed by Craig Small
parent 66e8e2723d
commit 12e070dd5f
2 changed files with 2 additions and 2 deletions

View File

@ -103,7 +103,7 @@ PROCPS_EXPORT int procps_ns_read_pid(
for (i=0; i < PROCPS_NS_COUNT; i++) { for (i=0; i < PROCPS_NS_COUNT; i++) {
snprintf(path, NSPATHLEN, "/proc/%d/ns/%s", pid, ns_names[i]); snprintf(path, NSPATHLEN, "/proc/%d/ns/%s", pid, ns_names[i]);
if (0 == stat(path, &st)) if (0 == stat(path, &st))
nsp->ns[i] = (long)st.st_ino; nsp->ns[i] = (unsigned long)st.st_ino;
else else
nsp->ns[i] = 0; nsp->ns[i] = 0;
} }

View File

@ -36,7 +36,7 @@ enum namespace_type {
}; };
struct procps_namespaces { struct procps_namespaces {
long ns[PROCPS_NS_COUNT]; unsigned long ns[PROCPS_NS_COUNT];
}; };
const char *procps_ns_get_name(const int id); const char *procps_ns_get_name(const int id);