100-daemon.patch 539 B

12345678910111213141516171819202122
  1. --- a/ntpclient.c
  2. +++ b/ntpclient.c
  3. @@ -611,7 +611,7 @@ int main(int argc, char *argv[]) {
  4. ntpc.cross_check=1;
  5. for (;;) {
  6. - c = getopt( argc, argv, "c:" DEBUG_OPTION "f:g:h:i:lp:q:" REPLAY_OPTION "st");
  7. + c = getopt( argc, argv, "c:" DEBUG_OPTION "f:g:h:i:lp:q:" REPLAY_OPTION "stD");
  8. if (c == EOF) break;
  9. switch (c) {
  10. case 'c':
  11. @@ -660,6 +660,10 @@ int main(int argc, char *argv[]) {
  12. (ntpc.cross_check)=0;
  13. break;
  14. + case 'D':
  15. + daemon(0, 0);
  16. + break;
  17. +
  18. default:
  19. usage(argv[0]);
  20. exit(1);