[git commit] vfork: fix clone based version

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Wed Jan 22 21:55:25 UTC 2014


commit: http://git.uclibc.org/uClibc/commit/?id=f9ea8850242a3afa9693c75e0b047acc6769ad44
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

The clone based version was introduced by commit

58570fc8e1fd601f15be5758ab95013d56771804
vfork: Use clone if arch does not have the vfork syscall

but the code was made unreachable by the previous commit

0a043c30ee71245dfe7c9d82d654312c5e1f6127
vfork: make all archs consistent

that adds a guard which require either __NR_vfork or __NR_fork
to be set.
Neither will be set on an arch that would need to use the
clone based version.

The double declaration of vfork was also introduced by
the merge of the two above mentioned patches.
The missing ; was present in the original patch.

CC: Markos Chandras <markos.chandras at imgtec.com>
CC: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
CC: Peter S. Mazinger <ps.m at gmx.net>
Signed-off-by: Stefan Kristiansson <stefan.kristiansson at saunalahti.fi>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 libc/sysdeps/linux/common/vfork.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/libc/sysdeps/linux/common/vfork.c b/libc/sysdeps/linux/common/vfork.c
index a85156d..81bcfc1 100644
--- a/libc/sysdeps/linux/common/vfork.c
+++ b/libc/sysdeps/linux/common/vfork.c
@@ -6,7 +6,7 @@
 
 #include <sys/syscall.h>
 
-#if (defined __NR_vfork || (defined __ARCH_USE_MMU__ && defined __NR_fork)) && (defined __USE_BSD || defined __USE_XOPEN_EXTENDED)
+#if (defined __NR_vfork || defined __NR_clone || (defined __ARCH_USE_MMU__ && defined __NR_fork)) && (defined __USE_BSD || defined __USE_XOPEN_EXTENDED)
 # include <unistd.h>
 extern __typeof(vfork) __vfork attribute_hidden;
 
@@ -20,12 +20,10 @@ pid_t __vfork(void)
 				   NULL, NULL, NULL);
 
 	if (pid < 0)
-		return -1
+		return -1;
 
 	return pid;
 }
-weak_alias(__vfork, vfork)
-libc_hidden_weak(vfork)
 
 # elif defined __NR_vfork
 #  define __NR___vfork __NR_vfork


More information about the uClibc-cvs mailing list