From 8cb88af8894399f3b68f9e027f8f6f4fc5575686 Mon Sep 17 00:00:00 2001 From: Thomas Osterried Date: Thu, 18 Aug 2011 10:43:49 +0000 Subject: call setsid() only if we are not already the process group leader --- ax25/axspawn.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ax25/axspawn.c b/ax25/axspawn.c index 5e6f8a1..5d0cfac 100644 --- a/ax25/axspawn.c +++ b/ax25/axspawn.c @@ -1,6 +1,6 @@ /* * - * $Id: axspawn.c,v 1.26 2011/08/18 10:21:27 dl9sau Exp $ + * $Id: axspawn.c,v 1.27 2011/08/18 10:43:49 dl9sau Exp $ * * axspawn.c - run a program from ax25d. * @@ -1693,7 +1693,11 @@ again: pututline(&ut_line); endutent(); - setsid(); + /* become process group leader, if we not already are */ + if (getpid() != getsid(0)) { + if (setsid() == -1) + exit(1); + } chargc = 0; envc = 0; -- cgit v1.2.3