library: ensure any 'flags' is consistently 'unsigned'

This commit is an outgrowth of the research into a bug
that recently surfaced with the 'w' program. And while
that program was just a victim several inconsistencies
were found in the handling of library flags during the
research. This patch just address such irregularities.

Reference(s):
http://www.freelists.org/post/procps/newlib-at-the-precipice,4

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner
2015-09-06 00:00:00 -05:00
committed by Craig Small
parent c39f4735c0
commit 5e46a145ba
3 changed files with 5 additions and 5 deletions

View File

@@ -210,7 +210,7 @@ typedef struct PROCTAB {
} PROCTAB;
// Initialize a PROCTAB structure holding needed call-to-call persistent data
extern PROCTAB* openproc(int flags, ... /* pid_t*|uid_t*|dev_t*|char* [, int n] */ );
extern PROCTAB* openproc(unsigned flags, ... /* pid_t*|uid_t*|dev_t*|char* [, int n] */ );
typedef struct proc_data_t { // valued by: (else zero)
proc_t **tab; // readproctab2, readproctab3
@@ -228,7 +228,7 @@ extern proc_data_t *readproctab3(int(*want_task)(proc_t *buf), PROCTAB *__restri
// table subset satisfying the constraints of flags and the optional PID list.
// Free allocated memory with exit(). Access via tab[N]->member. The pointer
// list is NULL terminated.
extern proc_t** readproctab(int flags, ... /* same as openproc */ );
extern proc_t** readproctab(unsigned flags, ... /* same as openproc */ );
// Clean-up open files, etc from the openproc()
extern void closeproc(PROCTAB* PT);