posix: Call _exit in failure case for posix_spawn{p} (BZ#20178)

Message ID 1464613642-4801-1-git-send-email-adhemerval.zanella@linaro.org
State Committed
Headers

Commit Message

Adhemerval Zanella May 30, 2016, 1:07 p.m. UTC
  This patch call _exit instead of exit in failure case for the spawned
child in Linux posix_spawn{p} implementation..

Tested on x86_64.

I will commit this shortly.

	[BZ #20178]
	* sysdeps/unix/sysv/linux/spawni.c (__spawni_child): Call _exit
	on failure instead of exit.
---
 ChangeLog                        | 6 ++++++
 sysdeps/unix/sysv/linux/spawni.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)
  

Patch

diff --git a/sysdeps/unix/sysv/linux/spawni.c b/sysdeps/unix/sysv/linux/spawni.c
index ee05de5..bb3eecf 100644
--- a/sysdeps/unix/sysv/linux/spawni.c
+++ b/sysdeps/unix/sysv/linux/spawni.c
@@ -288,7 +288,7 @@  fail:
   if (ret)
     while (write_not_cancel (p, &ret, sizeof ret) < 0)
       continue;
-  exit (SPAWN_ERROR);
+  _exit (SPAWN_ERROR);
 }
 
 /* Spawn a new process executing PATH with the attributes describes in *ATTRP.