From: Waschk,Kolja <av...@ix...> - 2003-12-02 18:42:39
|
Hi > According the man page for select(2), it could only set errno to these: [no EAGAIN] > Thus this line: > + if(selected<0 && errno==EAGAIN && start+2>time(0)) continue; > will never be true. Maybe - but the problem I found on my installation and that also had been reported by other users is caused because select() DOES return EAGAIN (avarice outputs "Resource temporarily unavailable"). It doesn't care about what's written in a man page... The other change (replacing read by the function with timeout) also shouldn't be necessary because the port was opened with O_NONBLOCK - but it DID block. Very probably these are actually CYGWIN problems, - but I had to find a solution quickly without trying all possible cygwin1.dll versions, so I went and implemented these workarounds. > Lastly, what was the actual g++ error/warning which prompted this > change? > + #ifndef __GETOPT_LONG_H__ > #include "gnu_getopt.h" > + #endif Some other include file included <getopt.h>, so "struct option" was already defined when gnu_getopt.h got included. I'll report the exact error tomorrow (at home I'm using linux;-) and the cygwin version(s) that are installed on that system. Kolja -- mr. kolja waschk - haubach-39 - 22765 hh - ger phone +49 40 889130-34 - fax -35 - e-mail s.a. |