+2008-10-06 Behdad Esfahbod <behdad@gnome.org>
+
+ Bug 555309 – giochannel breaks on error
+ Patch from Christian Persch
+
+ * glib/giounix.c (g_io_unix_read), (g_io_unix_write),
+ (g_io_unix_seek), (g_io_unix_close), (g_io_unix_set_flags):
+ Don't shadow err. Oops!
+
2008-10-06 Christophe Fergeau <teuf@gnome.org>
Bug 555224 – Improve g_format_size_for_display doc
if (result < 0)
{
- int err = errno;
+ int errsv = errno;
*bytes_read = 0;
- switch (err)
+ switch (errsv)
{
#ifdef EINTR
case EINTR:
#endif
default:
g_set_error_literal (err, G_IO_CHANNEL_ERROR,
- g_io_channel_error_from_errno (err),
- g_strerror (err));
+ g_io_channel_error_from_errno (errsv),
+ g_strerror (errsv));
return G_IO_STATUS_ERROR;
}
}
if (result < 0)
{
- int err = errno;
+ int errsv = errno;
*bytes_written = 0;
- switch (err)
+ switch (errsv)
{
#ifdef EINTR
case EINTR:
#endif
default:
g_set_error_literal (err, G_IO_CHANNEL_ERROR,
- g_io_channel_error_from_errno (err),
- g_strerror (err));
+ g_io_channel_error_from_errno (errsv),
+ g_strerror (errsv));
return G_IO_STATUS_ERROR;
}
}
if (result < 0)
{
- int err = errno;
+ int errsv = errno;
g_set_error_literal (err, G_IO_CHANNEL_ERROR,
- g_io_channel_error_from_errno (err),
- g_strerror (err));
+ g_io_channel_error_from_errno (errsv),
+ g_strerror (errsv));
return G_IO_STATUS_ERROR;
}
if (close (unix_channel->fd) < 0)
{
- int err = errno;
+ int errsv = errno;
g_set_error_literal (err, G_IO_CHANNEL_ERROR,
- g_io_channel_error_from_errno (err),
- g_strerror (err));
+ g_io_channel_error_from_errno (errsv),
+ g_strerror (errsv));
return G_IO_STATUS_ERROR;
}
if (fcntl (unix_channel->fd, F_SETFL, fcntl_flags) == -1)
{
- int err = errno;
+ int errsv = errno;
g_set_error_literal (err, G_IO_CHANNEL_ERROR,
- g_io_channel_error_from_errno (err),
- g_strerror (err));
+ g_io_channel_error_from_errno (errsv),
+ g_strerror (errsv));
return G_IO_STATUS_ERROR;
}