« Previous | Next » 

Revision ac8c26f6

IDac8c26f633b01bb32cdf347f9dbd5a80c6712925

Added by Laszlo Ersek almost 11 years ago

char: io_channel_send: don't lose written bytes

The g_io_channel_write_chars() documentation states,

bytes_written: The number of bytes written. This can be nonzero even if
the return value is not G_IO_STATUS_NORMAL. [...]

io_channel_send() could lose such bytes before.

Furthermore, the (status == G_IO_STATUS_EOF) condition used to evaluate to
constant false whenever it was reached. When that condition actually held,
it always led to -1 / EINVAL. This patch (almost) distinguishes
G_IO_STATUS_EOF only when no bytes have been written, and then treats it
as an error.

Signed-off-by: Laszlo Ersek <>
Reviewed-by: Amit Shah <>
Reviewed-by: Anthony Liguori <>
Message-id:
Signed-off-by: Anthony Liguori <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences