diff --git a/src/libCom/osi/os/vxWorks/iocClock.c b/src/libCom/osi/os/vxWorks/iocClock.c index db61955d9..f05ab44e3 100644 --- a/src/libCom/osi/os/vxWorks/iocClock.c +++ b/src/libCom/osi/os/vxWorks/iocClock.c @@ -28,6 +28,7 @@ of this distribution. #include "epicsMutex.h" #include "epicsTime.h" #include "iocClock.h" +#include "envDefs.h" #define BILLION 1000000000 #define iocClockSyncRate 10.0 @@ -111,6 +112,20 @@ void iocClockInit() errlogPrintf("No NTP server is defined. Clock does not work\n"); return; } + /* if TIMEZONE not defined set TIMEZONE from EPICS_TIMEZONE */ + if(getenv("TIMEZONE")==(char*)NULL) { + char timezone[80]; + char envtimezone[100]; + if(envGetConfigParam(&EPICS_TIMEZONE,sizeof(timezone),timezone)==NULL + || strlen(timezone)==0) { + printf("iocClockInit: No Time Zone Information\n"); + } else { + sprintf(envtimezone,"TIMEZONE=%s",timezone); + if(putenv(envtimezone)==ERROR) { + printf("iocClockInit: TIMEZONE putenv failed\n"); + } + } + } epicsThreadCreate("syncNTP", epicsThreadPriorityHigh, epicsThreadGetStackSize(epicsThreadStackSmall),