mirror of
https://github.com/webmin/webmin.git
synced 2025-07-23 00:30:33 +00:00
Handle failure of listen better
This commit is contained in:
@ -54,7 +54,7 @@ untie(*STDOUT);
|
|||||||
|
|
||||||
# Accept the TCP connection
|
# Accept the TCP connection
|
||||||
$acptaddr = accept(SOCK, MAIN);
|
$acptaddr = accept(SOCK, MAIN);
|
||||||
die "accept failed!" if (!$acptaddr);
|
die "accept failed : $!" if (!$acptaddr);
|
||||||
$oldsel = select(SOCK);
|
$oldsel = select(SOCK);
|
||||||
$| = 1;
|
$| = 1;
|
||||||
select($oldsel);
|
select($oldsel);
|
||||||
@ -307,7 +307,7 @@ while(1) {
|
|||||||
$$port++;
|
$$port++;
|
||||||
last if (bind($fh, sockaddr_in($$port, INADDR_ANY)));
|
last if (bind($fh, sockaddr_in($$port, INADDR_ANY)));
|
||||||
}
|
}
|
||||||
listen($fh, SOMAXCONN);
|
listen($fh, SOMAXCONN) || return "listed failed : $!";
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user