From: Martin Burnicki Date: Thu, 8 Nov 2007 17:08:38 +0000 (-0500) Subject: [Bug 713] Windows only: Let command line parameters from the Windows SCM GUI X-Git-Tag: NTP_4_2_5P97~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cba796c59c6c445ed1adfd3b7c39445ae6bfb657;p=thirdparty%2Fntp.git [Bug 713] Windows only: Let command line parameters from the Windows SCM GUI override the standard parameters from the ImagePath registry key. * Added HAVE_INT32_T to the Windows config.h to avoid duplicate definitions. bk: 47334296X0OLsq9Ph2JztaySGsnofg --- diff --git a/ChangeLog b/ChangeLog index b858da5da..99ebe90a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +* [Bug 957] Windows only: Let command line parameters from the Windows SCM GUI + override the standard parameters from the ImagePath registry key. +* Added HAVE_INT32_T to the Windows config.h to avoid duplicate definitions. * Update bugreport URL. * Update -I documentation. * [Bug 713] Fix bug reporting information. diff --git a/ports/winnt/include/config.h b/ports/winnt/include/config.h index 3fdefcf05..2a68fbbed 100644 --- a/ports/winnt/include/config.h +++ b/ports/winnt/include/config.h @@ -158,6 +158,7 @@ typedef unsigned int uintptr_t; #define pid_t int /* PID is an int */ #define ssize_t int /* ssize is an int */ typedef __int32 int32_t; /* define a typedef for int32_t */ +#define HAVE_INT32_T 1 /* * Map the stream to the file number diff --git a/ports/winnt/ntpd/ntservice.c b/ports/winnt/ntpd/ntservice.c index 065f510c0..14a3a8333 100644 --- a/ports/winnt/ntpd/ntservice.c +++ b/ports/winnt/ntpd/ntservice.c @@ -50,8 +50,17 @@ void ntservice_exit(void); void WINAPI service_main( DWORD argc, LPTSTR *argv ) { - /* pass the global command line options on to the service */ - ntpdmain( glb_argc, glb_argv ); + if ( argc > 1 ) + { + /* + * Let command line parameters from the Windows SCM GUI + * override the standard parameters from the ImagePath registry key. + */ + glb_argc = argc; + glb_argv = argv; + } + + ntpdmain( glb_argc, glb_argv ); }