Re: [AD] errno = EINTR troubles - any unix experts?

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Tue, 2002-09-17 at 09:03, Eric Botcazou wrote:
> > I assume, you also couldn't find out in QNX which signal interrupts
> > which function?
> 
> It was much simpler: for some strange reason, strftime() sets errno on QNX
> even though all seems to work fine.
> 
> > Everything is working again for me now, by disabling pthreads, thanks to
> > Vincent. This means using the SIGALRM timer can't be causing it, like
> > someone suggested, because it fails when it is not used - and works now
> > where I'm using it.
> 
> Ok, but that's obviously not the best solution.
> 
> > I'll maybe try installing a signal handler for all possible signals like
> > Vincent said, maybe I can figure out which system call gets interrupted
> > that way.
> 
> Can't you simply put a few breakpoints in src/file.c and find the point of
> failure ? For example, if allegro_errno is set to EINTR too, try lines 815,
> 1375, 1428, 1504, 1540 and 1700.
> 

Ok, I traced it down now. On my system, XLockDisplay() randomly sets
errno to 4 (EINTR) sometimes (and once also to 1 (EPERM) and to 3
(ESRCH) ?). So the fix now would be to move the "if (errno == 4) errno =
0;" line into the XLOCK() macro. The 1 and 3 case happen where they are
allowed it seems.. but the datedit functions check for errno, so the 4
is causing problems there. Maybe another fix would be to make datedit
check for allegro_errno, I don't think it should get set anywhere - but
I have no idea about the relation of allegro_errno and errno.

--
Elias Pschernig



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/