Miroslav Lichvar
2012-12-18 13:00:50 UTC
---
phc2sys.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/phc2sys.c b/phc2sys.c
index d0c97ae..2beddf3 100644
--- a/phc2sys.c
+++ b/phc2sys.c
@@ -331,6 +331,10 @@ int main(int argc, char *argv[])
fprintf(stderr, "can't autodiscover PHC device\n");
return -1;
}
+ if (ts_info.phc_index < 0) {
+ fprintf(stderr, "interface %s doesn't have a PHC\n", ethdev);
+ return -1;
+ }
sprintf(phc_device, "/dev/ptp%d", ts_info.phc_index);
src = clock_open(phc_device);
}
phc2sys.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/phc2sys.c b/phc2sys.c
index d0c97ae..2beddf3 100644
--- a/phc2sys.c
+++ b/phc2sys.c
@@ -331,6 +331,10 @@ int main(int argc, char *argv[])
fprintf(stderr, "can't autodiscover PHC device\n");
return -1;
}
+ if (ts_info.phc_index < 0) {
+ fprintf(stderr, "interface %s doesn't have a PHC\n", ethdev);
+ return -1;
+ }
sprintf(phc_device, "/dev/ptp%d", ts_info.phc_index);
src = clock_open(phc_device);
}
--
1.7.11.7
1.7.11.7