Commit d0ec964e d0ec964e0e522a7d7e6edda91a970d59539de730 by Alain Magloire

ChangeLog mailbox/tcp.c

Check the return value of close(2)
1 parent b87e34b3
2004-06-15 Alain Magloire
* mailbox/tcp.c(_tcp_close): Check the return value of close(2).
2004-06-15 Sergey Poznyakoff
* libmu_scm/Makefile.am (mailutils.scm): Fixed producing rule.
......
......@@ -62,12 +62,18 @@ static int
_tcp_close (stream_t stream)
{
struct _tcp_instance *tcp = stream_get_owner (stream);
int err = 0;
if (tcp->fd != -1)
close (tcp->fd);
{
if (close (tcp->fd) != 0)
{
err = errno;
}
}
tcp->fd = -1;
tcp->state = TCP_STATE_INIT;
return 0;
return err;
}
static int
......