linyacool / WebServer

A C++ High Performance Web Server
MIT License
7.77k stars 2.1k forks source link

close(-1) #63

Closed zjh7890 closed 3 months ago

zjh7890 commented 4 years ago

文件:Util.cpp 函数:int socket_bind_listen(int port)

if (listen_fd == -1) {
        close(listen_fd);
        return -1;
    }

close(-1) 会造成: errno: 9 description: Bad file descriptor 可能会覆盖有用的错误信息

linyacool commented 4 years ago

对,确实是个bug,我后面改一下,感谢提醒~