[PATCH xserver 1/2] shm, xwayland: prefer atomic close-on-exec without O_TMPFILE

Jan Beich jbeich at FreeBSD.org
Fri Jul 7 20:41:06 UTC 2017


Julien Cristau <jcristau at debian.org> writes:

> On Fri, Jul  7, 2017 at 16:31:48 +0200, Jan Beich wrote:
>> -	flags = fcntl(fd, F_GETFD);
>> +#ifndef HAVE_MKOSTEMP
>> +	int flags = fcntl(fd, F_GETFD);
>
> Do we allow mixed declarations and code nowadays?

xserver has quite a few of those already, even in Xext/shm.c e.g.,

  doShmPutImage(DrawablePtr dst, GCPtr pGC,
  ...
      else {
          GCPtr putGC = GetScratchGC(depth, dst->pScreen);
  ...
  ProcShmPutImage(ClientPtr client)
  ...
      if (stuff->sendEvent) {
          xShmCompletionEvent ev = {
              .type = ShmCompletionCode,
              .drawable = stuff->drawable,
              .minorEvent = X_ShmPutImage,
              .majorEvent = ShmReqCode,
              .shmseg = stuff->shmseg,
              .offset = stuff->offset
          };
  ...
  ProcPanoramiXShmCreatePixmap(ClientPtr client)
  ...
      FOR_NSCREENS(j) {
          ShmScrPrivateRec *screen_priv;
  ...
  ShmExtensionInit(void)
  ...
          for (i = 0; i < screenInfo.numScreens; i++) {
              ShmScrPrivateRec *screen_priv =
                  ShmInitScreenPriv(screenInfo.screens[i]);


More information about the xorg-devel mailing list