[Buildroot] [PATCH] quagga: Do not use fork on noMMU platforms

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Fri Jul 18 12:03:58 UTC 2014


Dear Yuvaraj Patil,

On Fri, 18 Jul 2014 17:27:43 +0530, Yuvaraj Patil wrote:
> fork() is not available in noMMU platforms, hence use vfork instead
> 
> fixes:
> http://autobuild.buildroot.net/results/1c5/1c5fdfe3a0248b65efdea0594d8367ff907015d4//
> 
> Signed-off-by: Yuvaraj Patil <yuvaraj.patil at wipro.com>
> ---
>  arch/Config.in              |    2 +-
>  package/quagga/quagga.patch |   28 ++++++++++++++++++++++++++++
>  2 files changed, 29 insertions(+), 1 deletion(-)
>  create mode 100644 package/quagga/quagga.patch
> 
> diff --git a/arch/Config.in b/arch/Config.in
> index 77fae7a..9cd85a5 100644
> --- a/arch/Config.in
> +++ b/arch/Config.in
> @@ -60,7 +60,7 @@ config BR2_avr32
>  	# do the lack of upstream support in the major toolchain
>  	# components. If you're interested by AVR32, contact the
>  	# Buildroot community. Otherwise, its support will be removed
> -	# in 2014.11.
> +	# by the 2015.02 release.
>  	depends on BR2_DEPRECATED_SINCE_2014_08
>  	help
>  	  The AVR32 is a 32-bit RISC microprocessor architecture designed by

This chunk is not related to quagga, so it shouldn't be part of your
patch.

> diff --git a/package/quagga/quagga.patch b/package/quagga/quagga.patch

Patches for packages should be named:

	<package>-<number>-<description>.patch.

See http://buildroot.org/downloads/manual/manual.html#patch-policy.

> new file mode 100644
> index 0000000..2949b2c
> --- /dev/null
> +++ b/package/quagga/quagga.patch

Patches must have a description + Signed-off-by line.

> @@ -0,0 +1,28 @@
> +diff -Nurp quagga-0.99.23_orig/babeld/util.c quagga-0.99.23/babeld/util.c
> +--- quagga-0.99.23_orig/babeld/util.c	2014-07-18 15:31:02.078625470 +0530
> ++++ quagga-0.99.23/babeld/util.c	2014-07-18 15:33:45.838618612 +0530
> +@@ -430,7 +430,11 @@ daemonise()
> +     fflush(stdout);
> +     fflush(stderr);
> + 
> ++#ifdef HAVE_FORK
> +     rc = fork();
> ++#else
> ++    rc = vfork();
> ++#endif

We have already received numerous patches like this from ADI, and each
time our answer was the same: please include in the patch description a
justification of why the fork() call can be replaced by vfork(). I'm
sure you know that vfork() is not equivalent to fork() and that we
cannot simply replace one by the other without checking carefully how
fork() is used. With vfork(), the parent process is blocked until the
child exits or calls exec(), and all changes made by the child will be
visible by the parent. There are therefore many situations in which
vfork() cannot be used as a replacement for fork().

We therefore want to see a justification for each patch making this
replacement.

Also, notice that since commit
http://git.buildroot.net/buildroot/commit/?id=26b482990870bdc9921ceaa3204eaf513e0be165,
quagga can no longer be selected on Blackfin, as I've added a MMU
dependency on the package. Of course, if you're interested in seeing
quagga becoming available on Blackfin, some changes are needed. If you
don't care specifically about quagga on Blackfin, we can live with it
being non-available in Buildroot for Blackfin.

Best regards,

Thomas Petazzoni
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com



More information about the buildroot mailing list