diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-10-08 14:55:14 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-10-08 14:55:14 +0000 |
commit | c94b212cb190feff808055bcedf7fc548ecb1e84 (patch) | |
tree | e812251b5998cec1767996cdfa22e69719828bd6 | |
parent | 0915f407809bdf13adb52d9e91b0454de8a97dc3 (diff) |
signal handles must not call exit() or use stdio; ok otto
-rw-r--r-- | usr.bin/pcc/cc/cc.c | 4 | ||||
-rw-r--r-- | usr.bin/pcc/ccom/main.c | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/usr.bin/pcc/cc/cc.c b/usr.bin/pcc/cc/cc.c index 9d273a55432..2ce4d56b21d 100644 --- a/usr.bin/pcc/cc/cc.c +++ b/usr.bin/pcc/cc/cc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cc.c,v 1.3 2007/10/08 12:02:12 stefan Exp $ */ +/* $OpenBSD: cc.c,v 1.4 2007/10/08 14:55:13 deraadt Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * @@ -610,6 +610,8 @@ dexit(int eval) cunlink(tmp3); cunlink(tmp4); } + if (eval == 100) + _exit(eval); exit(eval); } diff --git a/usr.bin/pcc/ccom/main.c b/usr.bin/pcc/ccom/main.c index fc4de8d774b..8f929a17a23 100644 --- a/usr.bin/pcc/ccom/main.c +++ b/usr.bin/pcc/ccom/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.1 2007/10/07 17:58:51 otto Exp $ */ +/* $OpenBSD: main.c,v 1.2 2007/10/08 14:55:13 deraadt Exp $ */ /* * Copyright (c) 2002 Anders Magnusson. All rights reserved. @@ -72,10 +72,12 @@ usage(void) static void segvcatch(int a) { - fprintf(stderr, "%sinternal compiler error: %s, line %d\n", + char buf[1024]; + + snprintf(buf, sizeof buf, "%sinternal compiler error: %s, line %d\n", nerrors ? "" : "major ", ftitle, lineno); - fflush(stderr); - exit(1); + write(STDERR_FILENO, buf, strlen(buf)); + _exit(1); } /* |