diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2007-12-14 15:30:47 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2007-12-14 15:30:47 +0000 |
commit | 71e99ae5555d601df8b90c92e990d9d46e848a96 (patch) | |
tree | df631bc021d4690fd260f77c8fec552bb43e0e9e /audio/headset.c | |
parent | b0f2b7bae42a94f9bd0250e7050fabbeb3fb5d25 (diff) |
Use write instead of g_io_channel_write (which is deprecated)
Diffstat (limited to 'audio/headset.c')
-rw-r--r-- | audio/headset.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/audio/headset.c b/audio/headset.c index 446c1eb5..c669b513 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,11 @@ 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; |