Re: [AD] errno = EINTR troubles - any unix experts? |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> 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) ?).
Good work!
> 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.
Oh My God(tm)! It looks like datedit.c is riddled with those @&$%!? checks
against errno :-( It is time to do some sweeping.
> 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.
allegro_errno is a pointer that serves a bridge between the shared library
and the user's errno: it is set to &errno by allegro_init() so that Allegro
can set the user's errno. It should not be used outside the library.
--
Eric Botcazou