about summary refs log tree commit diff
path: root/zshconfig.ac
diff options
context:
space:
mode:
Diffstat (limited to 'zshconfig.ac')
-rw-r--r--zshconfig.ac7
1 files changed, 3 insertions, 4 deletions
diff --git a/zshconfig.ac b/zshconfig.ac
index 3aee9fb08..0f4fe14e6 100644
--- a/zshconfig.ac
+++ b/zshconfig.ac
@@ -1377,10 +1377,9 @@ zsh_cv_sys_killesrch,
 #include <errno.h>
 main()
 {
-    int pid, ret;
-    pid=getpid() + 10000;
-    ret=kill(pid, 0);
-    exit(ret<0 && errno!=ESRCH);
+    int pid = (getpid() + 10000) & 0xffffff;
+    while (pid && (kill(pid, 0) == 0 || errno != ESRCH)) pid >>= 1;
+    exit(errno!=ESRCH);
 }
 ],
   zsh_cv_sys_killesrch=yes,