From: Alok <develnewbie@gmail.com>
To: BlueZ development <bluez-devel@lists.sourceforge.net>
Subject: [Bluez-devel] [PATCH] Fixes in headset_send
Date: Fri, 14 Dec 2007 20:51:13 +0530 [thread overview]
Message-ID: <1197645673.28907.22.camel@greatbear> (raw)
In-Reply-To: <200712141119.40846.denis.kenzior@trolltech.com>
[-- Attachment #1: Type: text/plain, Size: 155 bytes --]
Hello,
The following patch fixes headset_send(). It uses write() instead of
g_io_channel_write().
Let me know if anything needs to be changed.
-Alok.
[-- Attachment #2: headset_send.patch --]
[-- Type: text/x-patch, Size: 924 bytes --]
diff --git a/audio/headset.c b/audio/headset.c
index 446c1eb..2b9bfc8 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -136,7 +136,8 @@ static int headset_send(struct headset *hs, char *format, ...)
{
char rsp[BUF_SIZE];
va_list ap;
- gsize total_written, written, count;
+ ssize_t total_written, written, count;
+ int fd;
va_start(ap, format);
count = vsnprintf(rsp, sizeof(rsp), format, ap);
@@ -151,14 +152,12 @@ static int headset_send(struct headset *hs, char *format, ...)
}
written = total_written = 0;
+ fd = g_io_channel_unix_get_fd(hs->rfcomm);
while (total_written < count) {
- GIOError io_err;
-
- io_err = g_io_channel_write(hs->rfcomm, rsp + total_written,
- count - total_written,
- &written);
- if (io_err != G_IO_ERROR_NONE)
+ written = write(fd, rsp + total_written,
+ count - total_written);
+ if (written < 0)
return -errno;
total_written += written;
[-- Attachment #3: Type: text/plain, Size: 308 bytes --]
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
[-- 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
prev parent reply other threads:[~2007-12-14 15:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-14 1:19 [Bluez-devel] [PATCH] Fixes in rfcomm tty Denis KENZIOR
2007-12-14 15:21 ` Alok [this message]
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=1197645673.28907.22.camel@greatbear \
--to=develnewbie@gmail.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