public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] [Patch] Stop ctrl-c from aborting detached hciattach
@ 2006-10-05 20:43 Frank Mandarino
  0 siblings, 0 replies; only message in thread
From: Frank Mandarino @ 2006-10-05 20:43 UTC (permalink / raw)
  To: bluez-devel

[-- Attachment #1: Type: text/plain, Size: 730 bytes --]

Hi,

I was running some test programs on my embedded system, and noticed that
 my detached hciattach process, which I started from the command line,
was being killed when I entered ctrl-c to abort my test program.

The attached patch prevents signals generated by keyboard sequences,
such as ctrl-c, from being delivered to the detached hciattach process
by changing its process group id.

I'm not sure why daemon() wasn't called to create the detached process
like hcid does it, but calling setpgrp() seems to be sufficient.

Signed-off-by: Frank Mandarino <fmandarino@endrelia.com>

Regards,
../fam
-- 
Frank Mandarino                                fmandarino(a)endrelia.com
Endrelia Technologies Inc.
Toronto, Ontario, Canada

[-- Attachment #2: hciattach-setpgrp.patch --]
[-- Type: text/x-patch, Size: 486 bytes --]

Index: hciattach.c
===================================================================
RCS file: /cvsroot/bluez/utils/tools/hciattach.c,v
retrieving revision 1.41
diff -u -r1.41 hciattach.c
--- hciattach.c	10 Aug 2006 10:21:01 -0000	1.41
+++ hciattach.c	5 Oct 2006 20:19:50 -0000
@@ -1255,6 +1255,10 @@
 			return 0;
 		}
 
+		/* set a new process group so that ctrl-c
+		   won't abort the detached process */
+		setpgrp();
+
 		for (i = 0; i < 20; i++)
 			if (i != n)
 				close(i);

[-- Attachment #3: Type: text/plain, Size: 348 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-10-05 20:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-05 20:43 [Bluez-devel] [Patch] Stop ctrl-c from aborting detached hciattach Frank Mandarino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox