mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-07 10:20:29 +00:00
Replace perror logging with FATALF
This commit is contained in:
parent
e0c08389b9
commit
00477d4a74
1 changed files with 3 additions and 6 deletions
|
@ -6465,8 +6465,7 @@ static void Listen(void) {
|
||||||
servers.p[n].addr.sin_addr.s_addr = htonl(ips.p[i]);
|
servers.p[n].addr.sin_addr.s_addr = htonl(ips.p[i]);
|
||||||
if ((servers.p[n].fd = GoodSocket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC,
|
if ((servers.p[n].fd = GoodSocket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC,
|
||||||
IPPROTO_TCP, true, &timeout)) == -1) {
|
IPPROTO_TCP, true, &timeout)) == -1) {
|
||||||
perror("socket");
|
FATALF("socket: %m");
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
if (bind(servers.p[n].fd, &servers.p[n].addr,
|
if (bind(servers.p[n].fd, &servers.p[n].addr,
|
||||||
sizeof(servers.p[n].addr)) == -1) {
|
sizeof(servers.p[n].addr)) == -1) {
|
||||||
|
@ -6476,13 +6475,11 @@ static void Listen(void) {
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
if (listen(servers.p[n].fd, 10) == -1) {
|
if (listen(servers.p[n].fd, 10) == -1) {
|
||||||
perror("listen");
|
FATALF("listen: %m");
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
addrsize = sizeof(servers.p[n].addr);
|
addrsize = sizeof(servers.p[n].addr);
|
||||||
if (getsockname(servers.p[n].fd, &servers.p[n].addr, &addrsize) == -1) {
|
if (getsockname(servers.p[n].fd, &servers.p[n].addr, &addrsize) == -1) {
|
||||||
perror("getsockname");
|
FATALF("getsockname: %m");
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
port = ntohs(servers.p[n].addr.sin_port);
|
port = ntohs(servers.p[n].addr.sin_port);
|
||||||
ip = ntohl(servers.p[n].addr.sin_addr.s_addr);
|
ip = ntohl(servers.p[n].addr.sin_addr.s_addr);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue