From: Filippo Giunchedi <filippo@esaurito.net>
To: bluez-devel@lists.sf.net
Subject: [Bluez-devel] [PATCH] rfcomm 'anycommand' bug
Date: Fri, 2 Jun 2006 13:55:19 +0200 [thread overview]
Message-ID: <20060602115519.GA17462@esaurito.net> (raw)
[-- Attachment #1.1.1: Type: text/plain, Size: 468 bytes --]
Hi,
as reported in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=229167 rfcomm
silently exits (or better, does a print_dev_list()) if an unknown command
without parameters is passed. attached there is a patch (of the 'works-here'
type) which should solve the problem.
thanks,
filippo
--
Filippo Giunchedi - http://esaurito.net
PGP key: 0x6B79D401
random quote follows:
A child of five would understand this. Send someone to fetch a child of five.
-- Groucho Marx
[-- Attachment #1.1.2: rfcomm_anycommand.patch --]
[-- Type: text/plain, Size: 669 bytes --]
--- rfcomm/main.c (revision 154)
+++ rfcomm/main.c (working copy)
@@ -621,8 +621,20 @@
argv += optind;
optind = 0;
- if (argc < 2)
+ if (argc == 0) {
+ show_all = 1;
+ }else if (argc == 1){
+ for(i = 0; command[i].cmd; i++) {
+ if ((strncmp(command[i].cmd, argv[0], 4) == 0) &&
+ (strncmp(command[i].alt, argv[0], 4) == 0) )
+ break;
+
+ if (command[i+1].cmd == NULL)
+ usage();
+ exit(0);
+ }
show_all = 1;
+ }
if ((ctl = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_RFCOMM)) < 0 ) {
perror("Can't open RFCOMM control socket");
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next reply other threads:[~2006-06-02 11:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-02 11:55 Filippo Giunchedi [this message]
2006-06-02 15:09 ` [Bluez-devel] [PATCH] rfcomm 'anycommand' bug Marcel Holtmann
-- strict thread matches above, loose matches on Subject: below --
2006-06-03 13:57 Filippo Giunchedi
2006-06-04 13:19 ` Marcel Holtmann
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=20060602115519.GA17462@esaurito.net \
--to=filippo@esaurito.net \
--cc=bluez-devel@lists.sf.net \
--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;
as well as URLs for NNTP newsgroup(s).