top: still more tidying up after <pids> implementation

A patch containing the following miscellaneous tweaks:

. remove a function that handled former library errors
[ that function should have gone bye-bye with 3.3.11 ]
[ when those 'wchan' provisions were much simplified ]

. make clearer a distinction between 'new' and 'reset'
[ use PROCPS_PIDS_noop when procps_pids_new() called ]
[ since at that point we are only establishing depth ]

Reference(s):
http://www.freelists.org/post/procps/newlib-for-pgrep,1

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2015-09-01 00:00:00 -05:00 committed by Craig Small
parent 1b38b751ff
commit f1bd82ff07
2 changed files with 2 additions and 17 deletions

View File

@ -428,21 +428,6 @@ static void error_exit (const char *str) {
} // end: error_exit
/*
* Handle library errors ourselves rather than accept a default
* fprintf to stderr (since we've mucked with the termios struct) */
static void library_err (const char *fmts, ...) NORETURN;
static void library_err (const char *fmts, ...) {
static char tmp[MEDBUFSIZ];
va_list va;
va_start(va, fmts);
vsnprintf(tmp, sizeof(tmp), fmts, va);
va_end(va);
error_exit(tmp);
} // end: library_err
/*
* Catches all remaining signals not otherwise handled */
static void sig_abexit (int sig) {
@ -2926,8 +2911,9 @@ static void before (char *me) {
// establish max depth for newlib pids stack (# of result structs)
Pids_itms = alloc_c(sizeof(enum pids_item) * MAXTBL(Fieldstab));
for (i = 0; i < MAXTBL(Fieldstab); i++)
Pids_itms[i] = Fieldstab[i].item;
Pids_itms[i] = PROCPS_PIDS_noop;
Pids_itms_cur = i;
// we will identify specific items in the build_headers() function
if (procps_pids_new(&Pids_ctx, Pids_itms_cur, Pids_itms))
error_exit(fmtmk(N_fmt(LIB_errorpid_fmt),__LINE__));

View File

@ -590,7 +590,6 @@ typedef struct WIN_t {
//atic void at_eoj (void);
//atic void bye_bye (const char *str);
//atic void error_exit (const char *str);
//atic void library_err (const char *fmts, ...);
//atic void sig_abexit (int sig);
//atic void sig_endpgm (int dont_care_sig);
//atic void sig_paused (int dont_care_sig);