event_add return 1 when failed

This commit is contained in:
云风
2013-08-17 14:51:30 +08:00
parent dd188fd528
commit 93c0e257e7
2 changed files with 2 additions and 2 deletions

View File

@@ -278,7 +278,7 @@ gate_init(struct gate *g , struct skynet_context * ctx, char * parm) {
return 1;
}
if (max <=0 ) {
skynet_error(ctx, "Need max conntection");
skynet_error(ctx, "Need max connection");
return 1;
}
if (header != 'S' && header !='L') {

View File

@@ -284,7 +284,7 @@ mread_create(uint32_t addr, int port , int max , int buffer_size) {
return NULL;
}
if (event_add(efd, listen_fd, LISTENSOCKET) == -1) {
if (event_add(efd, listen_fd, LISTENSOCKET)) {
close(listen_fd);
close(efd);
return NULL;