check close return value

This commit is contained in:
Cloud Wu
2015-11-12 18:34:50 +08:00
parent b72f0921d4
commit d283d7fcaa

View File

@@ -337,7 +337,9 @@ force_close(struct socket_server *ss, struct socket *s, struct socket_message *r
sp_del(ss->event_fd, s->fd);
}
if (s->type != SOCKET_TYPE_BIND) {
close(s->fd);
if (close(s->fd) < 0) {
perror("close socket:");
}
}
s->type = SOCKET_TYPE_INVALID;
}