* [Buildroot] [PATCH v2 1/1] zeromq: don't use fork() on noMMU platforms
@ 2014-04-26 6:08 Jerzy Grzegorek
2014-04-26 9:47 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Jerzy Grzegorek @ 2014-04-26 6:08 UTC (permalink / raw)
To: buildroot
Fixes:
http://autobuild.buildroot.net/results/439/439df2ad4482d08f295dbc40b2e88bf9167a7794/
Signed-off-by: Jerzy Grzegorek <jerzy.grzegorek@trzebnica.net>
---
Changes v1 -> v2:
- change subject
- use an AC_CHECK_FUNCS(fork) test to build conditionally test_fork
package/zeromq/zeromq-01-no-mmu.patch | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
create mode 100644 package/zeromq/zeromq-01-no-mmu.patch
diff --git a/package/zeromq/zeromq-01-no-mmu.patch b/package/zeromq/zeromq-01-no-mmu.patch
new file mode 100644
index 0000000..0e0a4ca
--- /dev/null
+++ b/package/zeromq/zeromq-01-no-mmu.patch
@@ -0,0 +1,20 @@
+Don't use fork() on noMMU platforms
+
+Signed-off-by: Jerzy Grzegorek <jerzy.grzegorek@trzebnica.net>
+
+diff -rupN a/tests/test_fork.cpp b/tests/test_fork.cpp
+--- a/tests/test_fork.cpp 2013-11-13 18:57:50.000000000 +0100
++++ b/tests/test_fork.cpp 2014-04-24 08:57:01.000000000 +0200
+@@ -35,7 +35,11 @@ int main (void)
+ int rc = zmq_bind (pull, address);
+ assert (rc == 0);
+
+- int pid = fork ();
++#ifdef HAVE_FORK
++ int pid = fork();
++#else
++ int pid = vfork();
++#endif
+ if (pid == 0) {
+ // Child process
+ // Immediately close parent sockets and context
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH v2 1/1] zeromq: don't use fork() on noMMU platforms
2014-04-26 6:08 [Buildroot] [PATCH v2 1/1] zeromq: don't use fork() on noMMU platforms Jerzy Grzegorek
@ 2014-04-26 9:47 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2014-04-26 9:47 UTC (permalink / raw)
To: buildroot
Dear Jerzy Grzegorek,
On Sat, 26 Apr 2014 08:08:51 +0200, Jerzy Grzegorek wrote:
> +- int pid = fork ();
> ++#ifdef HAVE_FORK
> ++ int pid = fork();
> ++#else
> ++ int pid = vfork();
> ++#endif
Are you sure the child immediately does an exec() ? vfork() is not
equivalent to fork(), so one cannot be blindly replaced by the other.
Since the whole test is dedicated to testing fork, I think it doesn't
make sense to build it. So, your previous patch was better, it is just
that your previous patch was completely removing the build of
test_fork, while it should be conditional on whether the platform
implements fork() or not.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-04-26 9:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-26 6:08 [Buildroot] [PATCH v2 1/1] zeromq: don't use fork() on noMMU platforms Jerzy Grzegorek
2014-04-26 9:47 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox