summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-02-27 13:07:02 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-02-27 13:07:02 +0000
commitbebbd2498d580e91d8184970732383449d856a3c (patch)
tree89df4565bd4809ae350fe2ab1f8e9d7da7914930
parentaf47f85ea4422e8ec35564c1e26f84469c94c1e4 (diff)
Fake input: fixed build error when glib is disabled
-rw-r--r--input/device.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/input/device.c b/input/device.c
index bf20257e..0ae644a5 100644
--- a/input/device.c
+++ b/input/device.c
@@ -531,7 +531,6 @@ static gboolean rfcomm_io_cb(GIOChannel *chan, GIOCondition cond, gpointer data)
{
struct fake_input *fake = data;
const char *ok = "\r\nOK\r\n";
- GError *gerr = NULL;
char buf[BUF_SIZE];
gsize bread = 0, bwritten;
uint16_t key;
@@ -545,19 +544,16 @@ static gboolean rfcomm_io_cb(GIOChannel *chan, GIOCondition cond, gpointer data)
}
memset(buf, 0, BUF_SIZE);
- if (g_io_channel_read_chars(chan, (gchar *)buf, sizeof(buf) - 1,
- &bread, &gerr) != G_IO_STATUS_NORMAL) {
- error("IO Channel read error: %s", gerr->message);
- g_error_free(gerr);
+ if (g_io_channel_read(chan, buf, sizeof(buf) - 1,
+ &bread) != G_IO_ERROR_NONE) {
+ error("IO Channel read error");
goto failed;
}
debug("Received: %s", buf);
- if (g_io_channel_write_chars(chan, ok, 6, &bwritten,
- &gerr) != G_IO_STATUS_NORMAL) {
- error("IO Channel write error: %s", gerr->message);
- g_error_free(gerr);
+ if (g_io_channel_write(chan, ok, 6, &bwritten) != G_IO_ERROR_NONE) {
+ error("IO Channel write error");
goto failed;
}
@@ -568,7 +564,7 @@ static gboolean rfcomm_io_cb(GIOChannel *chan, GIOCondition cond, gpointer data)
return TRUE;
failed:
- g_io_channel_shutdown(fake->io, FALSE, NULL);
+ g_io_channel_close(chan);
g_io_channel_unref(chan);
ioctl(fake->uinput, UI_DEV_DESTROY);
close(fake->uinput);
@@ -925,7 +921,7 @@ static int disconnect(struct input_device *idev, uint32_t flags)
/* Fake input disconnect */
if (fake) {
if (fake->io) {
- g_io_channel_shutdown(fake->io, FALSE, NULL);
+ g_io_channel_close(fake->io);
g_io_channel_unref(fake->io);
fake->io = NULL;
}