On Wed,  5 Nov 2014 23:42:35 +0100, Richard Cochran wrote:
> This patch lets the ports (rather than the clock) remember the clock ID,
> passing it back to the clock code during synchronization. This does not
> represent a functional change, but rather paves the way for ports to
> override the clock ID when running a "jbod" BC.
> 
> Signed-off-by: Richard Cochran <[email protected]>
> ---
>  clock.c |   50 ++++++++++++++++++++++++--------------------------
>  clock.h |    2 ++
>  port.c  |    8 ++++++--
>  port.h  |    4 +++-
>  4 files changed, 35 insertions(+), 29 deletions(-)
> 
> diff --git a/clock.c b/clock.c
> index df82d2b..ca902ef 100644
> --- a/clock.c
> +++ b/clock.c
> @@ -72,7 +72,6 @@ struct clock_subscriber {
>  };
>  
>  struct clock {
> -     clockid_t clkid;
>       struct servo *servo;
>       struct defaultDS dds;
>       struct dataset default_dataset;
> @@ -268,9 +267,6 @@ void clock_destroy(struct clock *c)
>       }
>       port_close(c->uds_port);
>       free(c->pollfd);
> -     if (c->clkid != CLOCK_REALTIME) {
> -             phc_close(c->clkid);
> -     }

I don't like that phc_close is not called anymore after this patch.
I understand that it's not easy to do but IMHO this points out that
this approach is not the best one.

What about creating a reference counted structure holding clkid and
reference it from struct port? This seems even better to me than my
original patch splitting struct clock.

 Jiri

-- 
Jiri Benc

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to