Allow EPICS_TS_NTP_INET in environment to override NTP server setting.

This commit is contained in:
W. Eric Norum
2008-09-05 21:41:06 +00:00
parent 07927c5b5e
commit ab8fa0f5ec
2 changed files with 3 additions and 2 deletions

View File

@@ -416,6 +416,7 @@ Init (rtems_task_argument ignored)
{
int i;
char *argv[3] = { NULL, NULL, NULL };
char *cp;
rtems_task_priority newpri;
rtems_status_code sc;
rtems_time_of_day now;
@@ -462,6 +463,8 @@ Init (rtems_task_argument ignored)
/*
* Start network
*/
if ((cp = getenv("EPICS_TS_NTP_INET")) != NULL)
rtems_bsdnet_config.ntp_server[0] = cp;
if (rtems_bsdnet_config.network_task_priority == 0)
{
unsigned int p;

View File

@@ -202,7 +202,6 @@ setBootConfigFromNVRAM(void)
rtems_bsdnet_config.ntp_server[0] = gev("epics-ntpserver", nvp);
if (rtems_bsdnet_config.ntp_server[0] == NULL)
rtems_bsdnet_config.ntp_server[0] = rtems_bsdnet_bootp_server_name;
epicsEnvSet("EPICS_TS_NTP_INET",rtems_bsdnet_config.ntp_server[0]);
if ((cp = gev("epics-tz", nvp)) != NULL)
epicsEnvSet("TZ", cp);
}
@@ -319,7 +318,6 @@ setBootConfigFromNVRAM(void)
rtems_bsdnet_bootp_server_name = env("SERVER", "192.168.0.1");
rtems_bsdnet_config.name_server[0] = env("NAMESERVER", rtems_bsdnet_bootp_server_name);
rtems_bsdnet_config.ntp_server[0] = env("NTPSERVER", rtems_bsdnet_bootp_server_name);
epicsEnvSet("EPICS_TS_NTP_INET",rtems_bsdnet_config.ntp_server[0]);
cp1 = env("DOMAIN", NULL);
if (cp1 != NULL)
rtems_bsdnet_config.domainname = cp1;