[Linuxptp-devel] [PATCH v2] ts2phc: Prevent reporting poll error when received termination signal
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
|
From: Maciek M. <ma...@ma...> - 2023-04-11 13:08:57
|
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 <ma...@ma...>
---
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
|