[PATCH 2/5] xfree86: Remove xf86EnterServerState
Adam Jackson
ajax at redhat.com
Fri Dec 17 11:56:36 PST 2010
On Fri, 2010-12-17 at 15:10 +0200, Tiago Vignatti wrote:
> On Thu, Dec 16, 2010 at 03:31:37PM -0500, ext Adam Jackson wrote:
> > @@ -414,7 +414,8 @@ xf86ReleaseKeys(DeviceIntPtr pDev)
> > static void
> > xf86VTSwitch(void)
> > {
> > - int i, prevSIGIO;
> > + int i;
> > + static int prevSIGIO;
>
> AFAIU we don't need to use local static here. It will have the same behaviour.
Yes, we do need a static here.
Refer to the comment in the commit message. On VT switch away, we need
to suppress SIGIO; on VT switch to, we need to restore SIGIO state to
whatever it was when we switched away. Since we need to keep the state
across calls, we need a static.
> After reading this I've been wondering if we should need a return value on
> Block/UnblockSIGIO. Anyway, it's quite okay for me:
Well, it's basically a semaphore, so you need to keep track of the block
depth one way or another. Either you can do it like OsBlockSignals, or
you can push it to the callers with the return value.
- ajax
More information about the xorg-devel
mailing list