[hackers] [scc] [driver] Give a message error when some tool finish unexpectly || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Mon, 23 Jan 2017 13:03:43 +0100 (CET)

commit b46bf000cd4457444f0ac8489703a90b7c1b5453
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Mon Jan 23 13:02:03 2017 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Mon Jan 23 13:02:03 2017 +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.

diff --git a/driver/posix/scc.c b/driver/posix/scc.c
index 7cc1a3f..647affb 100644
--- a/driver/posix/scc.c
+++ b/driver/posix/scc.c
_AT_@ -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;
                 }
Received on Mon Jan 23 2017 - 13:03:43 CET

This archive was generated by hypermail 2.3.0 : Mon Jan 23 2017 - 13:12:17 CET