From: David Levine Date: Thu, 24 Mar 2016 23:55:58 +0000 (-0400) Subject: Use WIFXEXITED to check return status of system(), because X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/16ef810343953fd639b9f004f1e808fd94cbdf41?ds=inline;hp=-c Use WIFXEXITED to check return status of system(), because comparison with NOTOK wasn't valid. --- 16ef810343953fd639b9f004f1e808fd94cbdf41 diff --git a/uip/new.c b/uip/new.c index 2bb8c17a..9a7f9d4f 100644 --- a/uip/new.c +++ b/uip/new.c @@ -370,6 +370,8 @@ doit(char *cur, char *folders, char *sequences[]) return prev; } } else if (run_mode == UNSEEN) { + int status; + if (node->n_field == NULL) { continue; } @@ -388,7 +390,8 @@ doit(char *cur, char *folders, char *sequences[]) /* TODO: Split enough of scan.c out so that we can call it here. */ command = concat("scan +", node->n_name, " ", sequences_s, (void *)NULL); - if (system(command) == NOTOK) { + status = system(command); + if (! WIFEXITED (status)) { adios (command, "system"); } free(command);