network: use a function to turn network errors into string
So whether we decide to turn network errors into errno
or keep using net_errno
, the code logging network errors won't need to change.
Also report bind()
errors early which both simplifies the code and make the log order more logical on Linux.
v2: poll sets errno
on all error pathes on Windows, so don't use net_errno
to report poll errors.
Merge request reports
Activity
changed milestone to %4.0
added Component::Input: network streams label
assigned to @robUx4
mentioned in merge request !2148
added MRStatus::Reviewable label
It's not an accident that the existing VLC and POSIX functions take an explicit int.
errno
is subject to getting rewritten before it is used.Edited by Rémi Denis-Courmont
241 238 ptr->ai_protocol); 242 239 if (fd == -1) 243 240 { 244 msg_Dbg (p_this, "socket error: %s", vlc_strerror_c(net_errno)); 241 msg_Dbg (p_this, "socket error: %s", vlc_net_strerror_c()); 245 242 continue; 246 243 } 247 244 248 245 /* Bind the socket */ 249 246 if (bind (fd, ptr->ai_addr, ptr->ai_addrlen)) 250 247 { 251 int err = net_errno; 248 msg_Err (p_this, "socket bind error: %s", vlc_net_strerror_c()); added MRStatus::InReview label and removed MRStatus::Reviewable label
added MRStatus::Stale label and removed MRStatus::InReview label
mentioned in merge request !2496 (merged)