about summary refs log tree commit diff
path: root/zshconfig.ac
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2001-06-08 16:23:53 +0000
committerBart Schaefer <barts@users.sourceforge.net>2001-06-08 16:23:53 +0000
commit9675a70946e07dee97a61ef0408595a6a52b7b21 (patch)
tree4d1187a854b00468a5e776e92a0f36b6ceab057c /zshconfig.ac
parente16fdc2b16dce62fd6d15223b81540c9ec14428a (diff)
downloadzsh-9675a70946e07dee97a61ef0408595a6a52b7b21.tar.gz
zsh-9675a70946e07dee97a61ef0408595a6a52b7b21.tar.xz
zsh-9675a70946e07dee97a61ef0408595a6a52b7b21.zip
More reliable BROKEN_KILL_ESRCH test.
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,