]> diplodocus.org Git - nmh/commitdiff
Use WIFXEXITED to check return status of system(), because
authorDavid Levine <levinedl@acm.org>
Thu, 24 Mar 2016 23:55:58 +0000 (19:55 -0400)
committerDavid Levine <levinedl@acm.org>
Thu, 24 Mar 2016 23:55:58 +0000 (19:55 -0400)
comparison with NOTOK wasn't valid.

uip/new.c

index 2bb8c17a2ae954065b1d71a0dbe2a851a9687325..9a7f9d4f2bdc76fe4060ddf6db0a983964f4c555 100644 (file)
--- 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);