phc2sys: update usage/error reporting
This patch updates phc2sys usage reporting to give a slightly better indication of why the program was unable to run. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>master
parent
73105bc65a
commit
2a89756654
20
phc2sys.c
20
phc2sys.c
|
@ -663,9 +663,23 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(pps_fd >= 0 || src != CLOCK_INVALID) ||
|
if (pps_fd < 0 && src == CLOCK_INVALID) {
|
||||||
dst_clock.clkid == CLOCK_INVALID ||
|
fprintf(stderr,
|
||||||
(pps_fd >= 0 && dst_clock.clkid != CLOCK_REALTIME)) {
|
"valid source clock must be selected.\n");
|
||||||
|
usage(progname);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dst_clock.clkid == CLOCK_INVALID) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"valid destination clock must be selected.\n");
|
||||||
|
usage(progname);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pps_fd >= 0 && dst_clock.clkid != CLOCK_REALTIME) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"cannot use a pps device unless destination is CLOCK_REALTIME\n");
|
||||||
usage(progname);
|
usage(progname);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue