--- a/lib/master.c Sat May 31 15:37:33 2014 +1200
+++ b/lib/master.c Tue Apr 14 09:33:24 2015 -0400
@@ -715,11 +715,16 @@
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)));
- }
-
- return 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 0;
}
/****************************************************************************/