From: Mark Horton Date: Fri, 7 Nov 1980 06:48:54 +0000 (-0800) Subject: fixed syserror to handle quotas right on v7 X-Git-Tag: BSD-4^3~45 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/9d9622745a1d8177873aa7c350ef0d8bb7eddf53?hp=aad1cfb48dd9bd979015a31fc6184d3959b338bf fixed syserror to handle quotas right on v7 SCCS-vsn: usr.bin/ex/ex_subr.c 6.2 --- diff --git a/usr/src/usr.bin/ex/ex_subr.c b/usr/src/usr.bin/ex/ex_subr.c index 3cb8c92b30..d89b216405 100644 --- a/usr/src/usr.bin/ex/ex_subr.c +++ b/usr/src/usr.bin/ex/ex_subr.c @@ -1,5 +1,5 @@ /* Copyright (c) 1980 Regents of the University of California */ -static char *sccsid = "@(#)ex_subr.c 6.1 %G%"; +static char *sccsid = "@(#)ex_subr.c 6.2 %G%"; #include "ex.h" #include "ex_re.h" #include "ex_tty.h" @@ -664,13 +664,12 @@ short std_errlist[] = { error("Illegal seek"), error("Read-only file system"), error("Too many links"), - error("Broken pipe") -#ifndef QUOTA - , error("Math argument") - , error("Result too large") -#else - , error("Quota exceeded") + error("Broken pipe"), +#ifndef V6 + error("Math argument"), + error("Result too large"), #endif + error("Quota exceeded") /* Berkeley quota systems only */ }; #undef error @@ -807,3 +806,24 @@ markit(addr) if (addr != dot && addr >= one && addr <= dol) markDOT(); } + +/* + * The following code is defensive programming against a bug in the + * pdp-11 overlay implementation. Sometimes it goes nuts and asks + * for an overlay with some garbage number, which generates an emt + * trap. This is a less than elegant solution, but it is somewhat + * better than core dumping and losing your work, leaving your tty + * in a weird state, etc. + */ +int _ovno; +onemt() +{ + int oovno; + + signal(SIGEMT, onemt); + oovno = _ovno; + /* 2 and 3 are valid on 11/40 type vi, so */ + if (_ovno < 0 || _ovno > 3) + _ovno = 0; + error("emt trap, _ovno is %d @ - try again"); +}