]> git.wh0rd.org Git - nano.git/commitdiff
Change waits to waitpids to lessen the chance of a hang, and fix status check
authorChris Allegretta <chrisa@asty.org>
Mon, 9 Dec 2002 05:49:05 +0000 (05:49 +0000)
committerChris Allegretta <chrisa@asty.org>
Mon, 9 Dec 2002 05:49:05 +0000 (05:49 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1324 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

nano.c

diff --git a/nano.c b/nano.c
index 209be040d3b74f57a13eb3e55d544006c8294401..b50fb57bfcc4034929af7c97ec766feaa89684c8 100644 (file)
--- a/nano.c
+++ b/nano.c
@@ -1859,14 +1859,14 @@ int do_int_speller(char *tempfile_name)
 
     /* Process end of spell process */
 
-    wait(&spell_status);
-    wait(&sort_status);
-    wait(&uniq_status);
+    waitpid(pid_spell, &spell_status, WNOHANG);
+    waitpid(pid_sort, &sort_status, WNOHANG);
+    waitpid(pid_uniq, &uniq_status, WNOHANG);
 
     if (WIFEXITED(spell_status) && WIFEXITED(sort_status) 
            && WIFEXITED(uniq_status)) {
-       if (WEXITSTATUS(spell_status) != 0 || WEXITSTATUS(sort_status) 
-               || WEXITSTATUS(uniq_status))
+       if (WEXITSTATUS(spell_status) != 0 || WEXITSTATUS(sort_status) != 0 
+               || WEXITSTATUS(uniq_status) != 0)
            return FALSE;
     } else
         return FALSE;