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 <mlichvar@redhat.com>
master
Miroslav Lichvar 2018-04-13 17:11:59 +02:00 committed by Richard Cochran
parent e79e5040a0
commit 966eff0161
1 changed files with 2 additions and 0 deletions

View File

@ -1150,6 +1150,8 @@ static int auto_init_ports(struct node *node, int add_rt)
char iface[IFNAMSIZ]; char iface[IFNAMSIZ];
while (1) { while (1) {
if (!is_running())
return -1;
res = run_pmc_clock_identity(node, 1000); res = run_pmc_clock_identity(node, 1000);
if (res < 0) if (res < 0)
return -1; return -1;