base,cpu,dev: Simplify ListenSocket::listen().

Remove the "reuse" parameter which default to true and was always
also explicitly set to true. Tidy up the code itself slightly, mostly
by using "panic_if" to remove some nesting.

Change-Id: Ie23971aabf2fe4252d27f1887468360722a72379
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/69159
Maintainer: Gabe Black <gabeblack@google.com>
Reviewed-by: Yu-hsin Wang <yuhsingw@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2023-03-18 06:47:16 -07:00
committed by Gabe Black
parent daaccaa9ae
commit db1a5a367d
8 changed files with 24 additions and 38 deletions

View File

@@ -259,7 +259,7 @@ class TapListener
void
TapListener::listen()
{
while (!listener.listen(port, true)) {
while (!listener.listen(port)) {
DPRINTF(Ethernet, "TapListener(listen): Can't bind port %d\n", port);
port++;
}

View File

@@ -175,7 +175,7 @@ Terminal::listen(int port)
return;
}
while (!listener.listen(port, true)) {
while (!listener.listen(port)) {
DPRINTF(Terminal,
": can't bind address terminal port %d inuse PID %d\n",
port, getpid());