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: Robert Norris
Subject: Re: [gpsd-dev] [PATCH 3/3] Fix access to shared memory on Linux
Date: Tue, 7 Mar 2017 00:29:33 +0000

> 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.

Oh dear!

I better fix recent patch 3ae82ee27f38343e7982c6e96db0cdcd80a851b5 to Fix 
memory leak in Qt build too then.

--
Be Seeing You - Rob.
If at first you don't succeed,
then skydiving isn't for you.

________________________________________
From: gpsd-dev <address@hidden> on behalf of Gary E. Miller <address@hidden>
Sent: 06 March 2017 21:57:00
To: address@hidden
Subject: Re: [gpsd-dev] [PATCH 3/3] Fix access to shared memory on Linux

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



reply via email to

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