linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [Bluez-devel] [PATCH] rfcomm 'anycommand' bug
@ 2006-06-03 13:57 Filippo Giunchedi
  2006-06-04 13:19 ` Marcel Holtmann
  0 siblings, 1 reply; 4+ messages in thread
From: Filippo Giunchedi @ 2006-06-03 13:57 UTC (permalink / raw)
  To: bluez-devel

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

Hi Marcel,
attached there is a new patch (using tabs, "set noet" for the vim lovers) for
rfcomm, agreed it could be better. I hope it is clear enough.

thanks,
filippo
--
Filippo Giunchedi - http://esaurito.net
PGP key: 0x6B79D401
random quote follows:

The only way to get rid of a temptation is to yield to it.
-- Oscar Wilde

[-- Attachment #2: rfcomm.patch --]
[-- Type: text/plain, Size: 596 bytes --]

diff -u -r1.16 main.c
--- main.c	3 Jan 2006 13:29:01 -0000	1.16
+++ main.c	3 Jun 2006 13:54:33 -0000
@@ -621,8 +621,19 @@
 	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 #3: Type: text/plain, Size: 0 bytes --]



[-- 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] 4+ messages in thread
* [Bluez-devel] [PATCH] rfcomm 'anycommand' bug
@ 2006-06-02 11:55 Filippo Giunchedi
  2006-06-02 15:09 ` Marcel Holtmann
  0 siblings, 1 reply; 4+ messages in thread
From: Filippo Giunchedi @ 2006-06-02 11:55 UTC (permalink / raw)
  To: bluez-devel


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-06-04 13:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-03 13:57 [Bluez-devel] [PATCH] rfcomm 'anycommand' bug Filippo Giunchedi
2006-06-04 13:19 ` Marcel Holtmann
  -- strict thread matches above, loose matches on Subject: below --
2006-06-02 11:55 Filippo Giunchedi
2006-06-02 15:09 ` Marcel Holtmann

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).