Yes.

-----Original Message-----
From: Lars Munch <l...@segv.dk> 
Sent: Friday, 14 May 2021 18:20
To: Geva, Erez (ext) (DI PA DCP R&D 3) <erez.geva....@siemens.com>
Cc: linuxptp-devel@lists.sourceforge.net
Subject: Re: [Linuxptp-devel] [PATCH 2/4] ts2phc: Close socket on peer shutdown

On Fri, May 14, 2021 at 4:24 PM Geva, Erez <erez.geva....@siemens.com> wrote:
>
> Make sense to handle 0, end of file.
> But as it is NOT an error, perhaps it should use a proper pr_info().

So something like this?

cnt = read(pfd.fd, input, sizeof(input)); if (cnt <= 0) {
    if (cnt == 0)
        pr_info("disconnected from remote nmea source");
    else
        pr_err("failed to read from nmea source");
    close(pfd.fd);
    pfd.fd = -1;

_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to