less,klogd,syslogd,nc,tcpudp: exit on signal by killing itself, not exit(1)

*: minor shrink
This commit is contained in:
Denis Vlasenko
2008-02-24 13:36:01 +00:00
parent d553faf5a5
commit 400d8bb45e
14 changed files with 68 additions and 57 deletions

View File

@@ -174,7 +174,9 @@ static void less_exit(int code)
{
bb_putchar('\n');
set_tty_cooked();
exit(code); /* TODO: "suicide mode" for code == -signal */
if (code < 0)
kill_myself_with_sig(- code); /* does not return */
exit(code);
}
/* Move the cursor to a position (x,y), where (0,0) is the
@@ -1328,9 +1330,9 @@ static void keypress_process(int keypress)
number_process(keypress);
}
static void sig_catcher(int sig ATTRIBUTE_UNUSED)
static void sig_catcher(int sig)
{
less_exit(1) /* TODO: "suicide mode" for code == -signal */
less_exit(- sig);
}
int less_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;

View File

@@ -43,7 +43,7 @@ Cf:
#define TIMEOUT_LONG 10
#define MAXERRORS 10
static int read_byte(int fd, unsigned int timeout)
static int read_byte(int fd, unsigned timeout)
{
char buf[1];
int n;