From: Theodore A. R. <tr...@op...> - 2003-12-07 19:20:53
|
On Tue, 2 Dec 2003, Waschk,Kolja wrote: > > > > if(selected<0 && errno==EAGAIN && start+2>time(0)) continue; > > What about the purpose of start? > > I was afraid that select() could report EAGAIN endlessly, so the > special handling is "enabled" only unless 1-2 seconds passed. The > hardwired "+2" [seconds] is ugly; actually the "timeout" parameter > to the function should be taken into account > > > It's not obvious to me and needs a comment. > > You're right - the quality of my patch is quite poor... > Consider it to be just an "ugly hack" or "suggestion" for now > > > > Some other include file included <getopt.h>, so "struct option" was > > > already defined when gnu_getopt.h got included. > > Ok. That sucks. That's not an easy one to fix in the gnu_getopt.h > > header. > > Indeed that part of the patch isn't related to the EAGAIN or read() > problem - I should have omitted it (or put it in a separate patch) > > I hope there's time for me to prepare a proper update (with comments) > within the next days Can you try the attached patch and let me know if it works for you? I tested it on linux and it works fine. It doesn't have the start check after the select() call. Did you actually see the case where select() reported EAGAIN endlessly? If so, could it be handled with a simple fail counter (i.e. if select fails N times, bomb out) instead of using the time() call? I'd like to make an official 2.1 release this week and this patch is the only thing holding that up. Ted Roth |