[PATCH v2] OS/ACPI: Make socket to acpid is non-blocking

2013-09-16 Thread Egbert Eich
If a connect to the acpid socket is delayed connect will hang stalling the Xserver. To avoid this create a non-blocking socket. If connect returns EINPROGRESS use select() and getsockopt() to check for completion of the connect request. Use a different timeout to select() whether we connect for th

Re: [PATCH v2] OS/ACPI: Make socket to acpid is non-blocking

2013-11-13 Thread Keith Packard
Egbert Eich writes: > static CARD32 > lnxACPICheckTimer(OsTimerPtr timer, CARD32 now, pointer arg) > { > +struct timeval timeval = { 0, 0 }; > DebugF("ACPI: trying to reopen\n"); > -if (doLnxACPIOpen()) { > +if (doLnxACPIOpen(&timeval)) { Does this actually work with a timeou

Re: [PATCH v2] OS/ACPI: Make socket to acpid is non-blocking

2013-11-15 Thread Egbert Eich
On Thu, Nov 14, 2013 at 01:20:44PM +0900, Keith Packard wrote: > Egbert Eich writes: > > > static CARD32 > > lnxACPICheckTimer(OsTimerPtr timer, CARD32 now, pointer arg) > > { > > +struct timeval timeval = { 0, 0 }; > > DebugF("ACPI: trying to reopen\n"); > > -if (doLnxACPIOpen())

Re: [PATCH v2] OS/ACPI: Make socket to acpid is non-blocking

2013-11-15 Thread Egbert Eich
On Fri, Nov 15, 2013 at 11:25:49AM +0100, Egbert Eich wrote: > On Thu, Nov 14, 2013 at 01:20:44PM +0900, Keith Packard wrote: > > Egbert Eich writes: > > > > > static CARD32 > > > lnxACPICheckTimer(OsTimerPtr timer, CARD32 now, pointer arg) > > > { > > > +struct timeval timeval = { 0, 0 };