Fix coredump when two signals are sent in rapid succession.

PR:		bin/5721
Submitted by:	Oliver Fromme <oliver.fromme@heim3.tu-clausthal.de>

Also, add "volatile" to a variable modified by signal handlers (coincidentally,
the same variable involved in the above fix, although this isn't related
to the reported problem).
This commit is contained in:
Tim Vanderhoek 1998-07-31 04:05:11 +00:00
parent 89785a1654
commit b410b35213
2 changed files with 3 additions and 2 deletions
usr.bin/more

@ -58,7 +58,7 @@ static char sccsid[] = "@(#)os.c 8.1 (Berkeley) 6/6/93";
#include <less.h>
#include "pathnames.h"
int reading;
volatile int reading;
extern int screen_trashed;
@ -182,6 +182,7 @@ iread(fd, buf, len)
intread()
{
reading = 0;
(void)sigsetmask(0L);
longjmp(read_label, 1);
}

@ -66,7 +66,7 @@ extern int screen_trashed;
extern int lnloop;
extern int linenums;
extern int scroll;
extern int reading;
extern volatile int reading;
#ifdef SIGTSTP
/*