Ignore NXIO error otherwise this causes spam if network is empty or refclk not

selected yet, and syncing refclk time to master.
This commit is contained in:
Gavin Lambert 2015-04-14 09:33:24 -04:00
parent 0aaf68055e
commit 8b034e4aa6
1 changed files with 8 additions and 3 deletions

View File

@ -715,11 +715,16 @@ int ecrt_master_reference_clock_time(ec_master_t *master, uint32_t *time)
ret = ioctl(master->fd, EC_IOCTL_REF_CLOCK_TIME, time);
if (EC_IOCTL_IS_ERROR(ret)) {
fprintf(stderr, "Failed to get reference clock time: %s\n",
strerror(EC_IOCTL_ERRNO(ret)));
ret = EC_IOCTL_ERRNO(ret);
if (ret != EIO && ret != ENXIO) {
// do not log if no refclk or no refclk time yet
fprintf(stderr, "Failed to get reference clock time: %s\n",
strerror(ret));
}
return -ret;
}
return ret;
return 0;
}
/****************************************************************************/