From 966eff0161432ece087067e982b67eb6c3ff4442 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Fri, 13 Apr 2018 17:11:59 +0200 Subject: [PATCH] phc2sys: fix race between signals and port initialization. Check if a signal was received when waiting for ptp4l in the automatic mode to not get stuck in an infinite loop. Signed-off-by: Miroslav Lichvar --- phc2sys.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phc2sys.c b/phc2sys.c index c004066..00090cc 100644 --- a/phc2sys.c +++ b/phc2sys.c @@ -1150,6 +1150,8 @@ static int auto_init_ports(struct node *node, int add_rt) char iface[IFNAMSIZ]; while (1) { + if (!is_running()) + return -1; res = run_pmc_clock_identity(node, 1000); if (res < 0) return -1;