scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit b46bf000cd4457444f0ac8489703a90b7c1b5453
parent 17296a6730a37f0f80642a1d8fb08c582f104362
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 23 Jan 2017 13:02:03 +0100

[driver] Give a message error when some tool finish unexpectly

When a tool finishes without calling exit() or _exit() it means
that it worked wrong, usually a segmentation fault, and it is
very probable that without a message error. This patch adds
an "internal error" to show some error to the user.

Diffstat:
Mdriver/posix/scc.c | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/driver/posix/scc.c b/driver/posix/scc.c @@ -301,6 +301,10 @@ validatetools(void) if (waitpid(t->pid, &st, 0) < 0 || !WIFEXITED(st) || WEXITSTATUS(st) != 0) { + if (!WIFEXITED(st)) { + fprintf(stderr, + "scc:%s: internal error\n", t->bin); + } failure = 1; failed = tool; }