summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-03-11 22:25:15 -0700
committerKaz Kylheku <kaz@kylheku.com>2014-03-11 22:25:15 -0700
commit5382f4a6aa4a38c5f2f229f79bee55dfcb3843fc (patch)
tree7ae07decfd27a60929b2168bcd42382a84101ef1 /configure
parentd5915cf610b71691a95f5af3fe09848adb3f0d3d (diff)
downloadtxr-5382f4a6aa4a38c5f2f229f79bee55dfcb3843fc.tar.gz
txr-5382f4a6aa4a38c5f2f229f79bee55dfcb3843fc.tar.bz2
txr-5382f4a6aa4a38c5f2f229f79bee55dfcb3843fc.zip
* configure: new test for fcntl.
* stream.c (open_process): Fixed off-by one erroneous value of nargs, causing memory leak of one string. Fixed memory leak on fork failure. Fixed a deadlock that can occur in the pipe close function when multiple pipes are in existence. This is fixed by setting the FD_CLOEXEC flag on the pipe file descriptor. Without this, one child process can hold another's pipe open, causing that other one not to terminate when we're trying to shut it down, resulting in that child blocked on a write, while we block on waitpid.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure24
1 files changed, 24 insertions, 0 deletions
diff --git a/configure b/configure
index ddc8ee0b..c897c7e2 100755
--- a/configure
+++ b/configure
@@ -1330,6 +1330,30 @@ else
fi
#
+# fcntl
+#
+
+printf "Checking for POSIX fcntl ... "
+
+cat > conftest.c <<!
+#include "config.h"
+#include <fcntl.h>
+
+int main(int argc, char **argv)
+{
+ int err = fcntl(0, F_SETFD, FD_CLOEXEC);
+ return 0;
+}
+!
+
+if conftest ; then
+ printf "yes\n"
+ printf "#define HAVE_FCNTL_H 1\n" >> config.h
+else
+ printf "no\n"
+fi
+
+#
# Check for fields inside struct tm
#