[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patch] fix building on nommu systems (no fork)
From: |
Mike Frysinger |
Subject: |
Re: [patch] fix building on nommu systems (no fork) |
Date: |
Sun, 17 Jan 2010 17:18:58 -0500 |
User-agent: |
KMail/1.12.4 (Linux/2.6.32.3; KDE/4.3.4; x86_64; ; ) |
On Sunday 17 January 2010 17:07:22 Thomas Dickey wrote:
> On Sun, 17 Jan 2010, Mike Frysinger wrote:
> > one of the tests (ditto) uses fork() when it could just as easily use
> > vfork --
>
> it could (with a configure-check...)
i cant actually test this as latest ncurses snap seems to require some weird
versions of autotools, so regenerating them isnt happening.
diff --git a/configure.in b/configure.in
index 2f72227..d3db7f4 100644
--- a/configure.in
+++ b/configure.in
@@ -1349,6 +1349,7 @@ CF_LINK_DATAONLY
### Checks for library functions.
AC_CHECK_FUNCS( \
+fork \
getcwd \
getegid \
geteuid \
@@ -1366,6 +1367,7 @@ strdup \
strstr \
tcgetpgrp \
times \
+vfork \
vsnprintf \
)
if test "$with_getcap" = "yes" ; then
diff --git a/test/ditto.c b/test/ditto.c
index 387f707..434eed6 100644
--- a/test/ditto.c
+++ b/test/ditto.c
@@ -161,7 +161,13 @@ open_tty(char *path)
failed(slave_name);
}
sprintf(s_option, "-S%s/%d", slave_name, aslave);
+#if defined(HAVE_FORK)
if (fork()) {
+#elif defined(HAVE_VFORK)
+ if (vfork() == 0) {
+#else
+# error boo no fork
+#endif
execlp("xterm", "xterm", s_option, "-title", path, (char *) 0);
_exit(0);
}
-mike
signature.asc
Description: This is a digitally signed message part.