Date: Wed, 31 Mar 1999 09:17:07 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> To: Graham Wheeler <gram@cdsec.com> Cc: Ladavac Marino <mladavac@metropolitan.at>, hackers@FreeBSD.ORG Subject: Re: select() on UDP socket returns ECONNREFUSED Message-ID: <199903311717.JAA49728@apollo.backplane.com> References: <97A8CA5BF490D211A94F0000F6C2E55D097583@s-lmh-wi-900.corpnet.at> <37020CE5.477F888D@cdsec.com>
next in thread | previous in thread | raw e-mail | index | archive | help
:> Do you mean, select returns -1 and sets errno to ECONNREFUSED? : :Oops (hides head in embarassment). I just checked the code (which :wasn't mine) and saw that the error gets logged if the select returns :something other than 1 and errno isn't EINTR. Which means that this is :happening when the select times out and returns zero. : :Turns out the person who wrote the code erroneously assumed that :select() would return errno==EINTR if it timed out. : :-- :Dr Graham Wheeler E-mail: gram@cdsec.com :Citadel Data Security Phone: +27(21)423-6065/6/7 :Firewalls/Virtual Private Networks Fax: +27(21)24-3656 :Internet/Intranet Network Specialists :Data Security Products WWW: http://www.cdsec.com/ People should remember that system calls do *NOT* clear errno. If errno is set from a previous error, it stays set even if the system call succeeds. Also, system and library routines do not reliably overwrite errno if errno is non-zero prior to making the call. If you intend to check errno after a library or system call returns < 0, you have clear errno prior to making the call or you may get stale data. -Matt Matthew Dillon <dillon@backplane.com> To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199903311717.JAA49728>