use localtime_r, not localtime

This commit is contained in:
Glenn Maynard
2004-02-23 01:16:22 +00:00
parent 6def357f15
commit 19ed4d89b2
+6 -4
View File
@@ -557,8 +557,9 @@ void ConditionalBGA::CheckBgaRequirements(BgaCondInfo info)
{
time_t rawtime;
time(&rawtime);
struct tm* ptm = localtime(&rawtime);
int month = ptm->tm_mon; /* Month 0..11 */
struct tm ptm;
localtime_r( &rawtime, &ptm );
int month = ptm.tm_mon; /* Month 0..11 */
LOG->Info("Month: %d",month);
bool foundvalidmonth = false;
for(unsigned d=0;d<info.songmonths.size();d++)
@@ -578,8 +579,9 @@ void ConditionalBGA::CheckBgaRequirements(BgaCondInfo info)
{
time_t rawtime;
time(&rawtime);
struct tm* ptm = localtime(&rawtime);
int day = ptm->tm_mday; /* day in the month */
struct tm ptm;
localtime_r( &rawtime, &ptm );
int day = ptm.tm_mday; /* day in the month */
LOG->Info("DAy: %d",day);
bool foundvalidday = false;
for(unsigned d=0;d<info.songdays.size();d++)