public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Frank Mandarino <fmandarino@endrelia.com>
To: bluez-devel@lists.sourceforge.net
Subject: [Bluez-devel] [Patch] Stop ctrl-c from aborting detached hciattach
Date: Thu, 05 Oct 2006 16:43:48 -0400	[thread overview]
Message-ID: <eg3qq2$9mm$1@sea.gmane.org> (raw)

[-- 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

                 reply	other threads:[~2006-10-05 20:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='eg3qq2$9mm$1@sea.gmane.org' \
    --to=fmandarino@endrelia.com \
    --cc=bluez-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox