Currently ts2phc prints "poll failed" error to the LOG_EMERG when
the poll for tod fails. This causes error print on all terminals
when the tool gets terminated using SIGINT (ex. by pressing CTRL+C).

v2: Properly handle poll interrupt to prevent the error

Signed-off-by: Maciek Machnikowski <mac...@machnikowski.net>
---
 ts2phc_pps_sink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ts2phc_pps_sink.c b/ts2phc_pps_sink.c
index d25bc89..05ac225 100644
--- a/ts2phc_pps_sink.c
+++ b/ts2phc_pps_sink.c
@@ -381,7 +381,7 @@ int ts2phc_pps_sink_poll(struct ts2phc_private *priv)
 
                cnt = poll(polling_array->pfd, priv->n_sinks, 2000);
                if (cnt < 0) {
-                       if (errno == -EINTR) {
+                       if (errno == EINTR) {
                                return 0;
                        } else {
                                pr_emerg("poll failed");
-- 
2.30.2



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

Reply via email to