mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-27 19:33:23 +00:00
Fix error codes in bind
, listen
, and accept
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
346887ace5
commit
92a9f5616e
@ -77,7 +77,7 @@ impl IfaceCommon {
|
||||
return Ok(port);
|
||||
}
|
||||
}
|
||||
return_errno_with_message!(Errno::EAGAIN, "cannot find unused high port");
|
||||
return_errno_with_message!(Errno::EAGAIN, "no ephemeral port is available");
|
||||
}
|
||||
|
||||
fn bind_port(&self, port: u16, can_reuse: bool) -> Result<()> {
|
||||
@ -86,7 +86,7 @@ impl IfaceCommon {
|
||||
if *used_times == 0 || can_reuse {
|
||||
*used_times += 1;
|
||||
} else {
|
||||
return_errno_with_message!(Errno::EADDRINUSE, "cannot bind port");
|
||||
return_errno_with_message!(Errno::EADDRINUSE, "the address is already in use");
|
||||
}
|
||||
} else {
|
||||
used_ports.insert(port, 1);
|
||||
|
Reference in New Issue
Block a user