gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] [PATCH 3/3] Fix access to shared memory on Linux


From: Gary E. Miller
Subject: Re: [gpsd-dev] [PATCH 3/3] Fix access to shared memory on Linux
Date: Mon, 6 Mar 2017 13:57:00 -0800

Yo Robert!

On Sun, 5 Mar 2017 23:16:18 +0000
Robert Norris <address@hidden> wrote:

> Unfortunately this means the shared memory segment still needs to be
> managed manually on Linux.

Maybe, but this patch is not good.

>  bool shm_acquire(struct gps_context_t *context)
>  /* initialize the shared-memory segment to be used for export */
>  {
> -    int status;

Notice the defintion at the top of the function?

> gps_context_t *context) context->shmexport = NULL;
>       return false;
>      }

And we had some code.

> +    int status = shmctl(shmid, IPC_RMID, NULL);

Now you define the variable inline.  Many compilers only allow
defining a stack var at the top of a block.  So this will fail
on older compilers.

And and that point I stopped looking.


RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        address@hidden  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin

Attachment: pgp6gwJkm8ti9.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]