Commit d0ec964e d0ec964e0e522a7d7e6edda91a970d59539de730 by Alain Magloire

ChangeLog mailbox/tcp.c

Check the return value of close(2)
1 parent b87e34b3
1 2004-06-15 Alain Magloire
2
3 * mailbox/tcp.c(_tcp_close): Check the return value of close(2).
4
1 2004-06-15 Sergey Poznyakoff 5 2004-06-15 Sergey Poznyakoff
2 6
3 * libmu_scm/Makefile.am (mailutils.scm): Fixed producing rule. 7 * libmu_scm/Makefile.am (mailutils.scm): Fixed producing rule.
......
...@@ -62,12 +62,18 @@ static int ...@@ -62,12 +62,18 @@ static int
62 _tcp_close (stream_t stream) 62 _tcp_close (stream_t stream)
63 { 63 {
64 struct _tcp_instance *tcp = stream_get_owner (stream); 64 struct _tcp_instance *tcp = stream_get_owner (stream);
65 int err = 0;
65 66
66 if (tcp->fd != -1) 67 if (tcp->fd != -1)
67 close (tcp->fd); 68 {
69 if (close (tcp->fd) != 0)
70 {
71 err = errno;
72 }
73 }
68 tcp->fd = -1; 74 tcp->fd = -1;
69 tcp->state = TCP_STATE_INIT; 75 tcp->state = TCP_STATE_INIT;
70 return 0; 76 return err;
71 } 77 }
72 78
73 static int 79 static int
......