Add common refclock driver option parsing

This commit is contained in:
Miroslav Lichvar
2010-01-28 09:14:42 +01:00
parent e261278a5c
commit a0e1154bfb
4 changed files with 41 additions and 9 deletions

View File

@@ -46,15 +46,10 @@ static int pps_initialise(RCL_Instance instance) {
pps_params_t params;
struct pps_instance *pps;
int fd, edge_clear, mode;
char *path, *s;
char *path;
path = RCL_GetDriverParameter(instance);
edge_clear = 0;
if ((s = strrchr(path, ':')) != NULL) {
*s = '\0';
edge_clear = atoi(s + 1);
}
edge_clear = RCL_GetDriverOption(instance, "clear") ? 1 : 0;
fd = open(path, O_RDWR);
if (fd < 0) {