diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2011-05-27 09:52:31 -0700 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2011-05-27 09:52:31 -0700 |
commit | 3297a3e865daadbedd1d03b1e50bddc32c0254b5 (patch) | |
tree | 7a818390c5f7d2521f5d4c63f8a3bb7037514076 /gatchat | |
parent | f13bedd9dc1cd9a6e373bf686475e8713c10a605 (diff) | |
download | ofono-3297a3e865daadbedd1d03b1e50bddc32c0254b5.tar.bz2 |
gatchat: Fix unused variable cases
Diffstat (limited to 'gatchat')
-rw-r--r-- | gatchat/gathdlc.c | 15 | ||||
-rw-r--r-- | gatchat/ppp_net.c | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/gatchat/gathdlc.c b/gatchat/gathdlc.c index 1d5f239c..130e3cce 100644 --- a/gatchat/gathdlc.c +++ b/gatchat/gathdlc.c @@ -95,13 +95,28 @@ static void hdlc_record(int fd, gboolean in, guint8 *data, guint16 length) ts = htonl(now.tv_sec & 0xffffffff); id = 0x07; + err = write(fd, &id, 1); + if (err < 0) + return; + err = write(fd, &ts, 4); + if (err < 0) + return; id = in ? 0x02 : 0x01; + err = write(fd, &id, 1); + if (err < 0) + return; + err = write(fd, &len, 2); + if (err < 0) + return; + err = write(fd, data, length); + if (err < 0) + return; } void g_at_hdlc_set_recording(GAtHDLC *hdlc, const char *filename) diff --git a/gatchat/ppp_net.c b/gatchat/ppp_net.c index 6facc6d7..7ce7bc81 100644 --- a/gatchat/ppp_net.c +++ b/gatchat/ppp_net.c @@ -87,6 +87,8 @@ void ppp_net_process_packet(struct ppp_net *net, const guint8 *packet) len = get_host_short(&packet[2]); status = g_io_channel_write_chars(net->channel, (gchar *) packet, len, &bytes_written, NULL); + if (status != G_IO_STATUS_NORMAL) + return; } /* |