top: eliminate the 'keys_global' redundant definitions <=== port of newlib 27f5904e
[ can't implement Ctrl-R with AGNI, it ain't present ] ______________________________ original newlib message --------------------------------------------- ( none ) Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
parent
84a1bc779a
commit
673fe994f9
33
top/top.c
33
top/top.c
@ -5292,7 +5292,7 @@ static void write_rcfile (void) {
|
|||||||
|
|
||||||
static void keys_global (int ch) {
|
static void keys_global (int ch) {
|
||||||
WIN_t *w = Curwin; // avoid gcc bloat with a local copy
|
WIN_t *w = Curwin; // avoid gcc bloat with a local copy
|
||||||
int i;
|
int i, num, def, pid;
|
||||||
|
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case '?':
|
case '?':
|
||||||
@ -5349,20 +5349,20 @@ static void keys_global (int ch) {
|
|||||||
if (Secure_mode)
|
if (Secure_mode)
|
||||||
show_msg(N_txt(NOT_onsecure_txt));
|
show_msg(N_txt(NOT_onsecure_txt));
|
||||||
else {
|
else {
|
||||||
int sig = SIGTERM,
|
num = SIGTERM;
|
||||||
def = w->ppt[w->begtask]->tid,
|
def = w->ppt[w->begtask]->tid;
|
||||||
pid = get_int(fmtmk(N_txt(GET_pid2kill_fmt), def));
|
pid = get_int(fmtmk(N_txt(GET_pid2kill_fmt), def));
|
||||||
if (pid > GET_NUM_ESC) {
|
if (pid > GET_NUM_ESC) {
|
||||||
char *str;
|
char *str;
|
||||||
if (pid == GET_NUM_NOT) pid = def;
|
if (pid == GET_NUM_NOT) pid = def;
|
||||||
str = ioline(fmtmk(N_fmt(GET_sigs_num_fmt), pid, SIGTERM));
|
str = ioline(fmtmk(N_fmt(GET_sigs_num_fmt), pid, SIGTERM));
|
||||||
if (*str != kbd_ESC) {
|
if (*str != kbd_ESC) {
|
||||||
if (*str) sig = signal_name_to_number(str);
|
if (*str) num = signal_name_to_number(str);
|
||||||
if (Frames_signal) break;
|
if (Frames_signal) break;
|
||||||
if (0 < sig && kill(pid, sig))
|
if (0 < num && kill(pid, num))
|
||||||
show_msg(fmtmk(N_fmt(FAIL_signals_fmt)
|
show_msg(fmtmk(N_fmt(FAIL_signals_fmt)
|
||||||
, pid, sig, strerror(errno)));
|
, pid, num, strerror(errno)));
|
||||||
else if (0 > sig) show_msg(N_txt(BAD_signalid_txt));
|
else if (0 > num) show_msg(N_txt(BAD_signalid_txt));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5371,16 +5371,15 @@ static void keys_global (int ch) {
|
|||||||
if (Secure_mode)
|
if (Secure_mode)
|
||||||
show_msg(N_txt(NOT_onsecure_txt));
|
show_msg(N_txt(NOT_onsecure_txt));
|
||||||
else {
|
else {
|
||||||
int val,
|
def = w->ppt[w->begtask]->tid;
|
||||||
def = w->ppt[w->begtask]->tid,
|
pid = get_int(fmtmk(N_fmt(GET_pid2nice_fmt), def));
|
||||||
pid = get_int(fmtmk(N_fmt(GET_pid2nice_fmt), def));
|
|
||||||
if (pid > GET_NUM_ESC) {
|
if (pid > GET_NUM_ESC) {
|
||||||
if (pid == GET_NUM_NOT) pid = def;
|
if (pid == GET_NUM_NOT) pid = def;
|
||||||
val = get_int(fmtmk(N_fmt(GET_nice_num_fmt), pid));
|
num = get_int(fmtmk(N_fmt(GET_nice_num_fmt), pid));
|
||||||
if (val > GET_NUM_NOT
|
if (num > GET_NUM_NOT
|
||||||
&& setpriority(PRIO_PROCESS, (unsigned)pid, val))
|
&& setpriority(PRIO_PROCESS, (unsigned)pid, num))
|
||||||
show_msg(fmtmk(N_fmt(FAIL_re_nice_fmt)
|
show_msg(fmtmk(N_fmt(FAIL_re_nice_fmt)
|
||||||
, pid, val, strerror(errno)));
|
, pid, num, strerror(errno)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -5396,8 +5395,8 @@ static void keys_global (int ch) {
|
|||||||
if (!Inspect.total)
|
if (!Inspect.total)
|
||||||
ioline(N_txt(YINSP_noents_txt));
|
ioline(N_txt(YINSP_noents_txt));
|
||||||
else {
|
else {
|
||||||
int def = w->ppt[w->begtask]->tid,
|
def = w->ppt[w->begtask]->tid;
|
||||||
pid = get_int(fmtmk(N_fmt(YINSP_pidsee_fmt), def));
|
pid = get_int(fmtmk(N_fmt(YINSP_pidsee_fmt), def));
|
||||||
if (pid > GET_NUM_ESC) {
|
if (pid > GET_NUM_ESC) {
|
||||||
if (pid == GET_NUM_NOT) pid = def;
|
if (pid == GET_NUM_NOT) pid = def;
|
||||||
if (pid) inspection_utility(pid);
|
if (pid) inspection_utility(pid);
|
||||||
|
Loading…
Reference in New Issue
Block a user