* localtime.cc (tzload): Don't change global timezone information
when called from gmtime or gmtime_r. (tzparse): Ditto.
This commit is contained in:
		| @@ -1,3 +1,9 @@ | |||||||
|  | 2011-04-18  Corinna Vinschen  <corinna@vinschen.de> | ||||||
|  |  | ||||||
|  | 	* localtime.cc (tzload): Don't change global timezone information | ||||||
|  | 	when called from gmtime or gmtime_r. | ||||||
|  | 	(tzparse): Ditto. | ||||||
|  |  | ||||||
| 2011-04-18  Corinna Vinschen  <corinna@vinschen.de> | 2011-04-18  Corinna Vinschen  <corinna@vinschen.de> | ||||||
|  |  | ||||||
| 	* cygtls.cc (_cygtls::remove): Always close sockevt handle. | 	* cygtls.cc (_cygtls::remove): Always close sockevt handle. | ||||||
|   | |||||||
| @@ -866,10 +866,13 @@ tzload(const char *name, struct state *sp) | |||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  | 	if (sp == lclptr) | ||||||
|  | 	  { | ||||||
| 	    __gettzinfo ()->__tzrule[0].offset | 	    __gettzinfo ()->__tzrule[0].offset | ||||||
| 				    = -sp->ttis[1].tt_gmtoff; | 				    = -sp->ttis[1].tt_gmtoff; | ||||||
| 	    __gettzinfo ()->__tzrule[1].offset | 	    __gettzinfo ()->__tzrule[1].offset | ||||||
| 				    = -sp->ttis[0].tt_gmtoff; | 				    = -sp->ttis[0].tt_gmtoff; | ||||||
|  | 	  } | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -1243,10 +1246,13 @@ tzparse(const char *name, struct state *sp, const int lastditch) | |||||||
| 				janfirst += year_lengths[isleap(year)] * | 				janfirst += year_lengths[isleap(year)] * | ||||||
| 					SECSPERDAY; | 					SECSPERDAY; | ||||||
| 			} | 			} | ||||||
|  | 			if (sp == lclptr) | ||||||
|  | 			  { | ||||||
| 			    __gettzinfo ()->__tzrule[0].offset | 			    __gettzinfo ()->__tzrule[0].offset | ||||||
| 						    = -sp->ttis[1].tt_gmtoff; | 						    = -sp->ttis[1].tt_gmtoff; | ||||||
| 			    __gettzinfo ()->__tzrule[1].offset | 			    __gettzinfo ()->__tzrule[1].offset | ||||||
| 						    = -sp->ttis[0].tt_gmtoff; | 						    = -sp->ttis[0].tt_gmtoff; | ||||||
|  | 			  } | ||||||
| 		} else { | 		} else { | ||||||
| 			register long	theirstdoffset; | 			register long	theirstdoffset; | ||||||
| 			register long	theirdstoffset; | 			register long	theirdstoffset; | ||||||
| @@ -1333,11 +1339,14 @@ tzparse(const char *name, struct state *sp, const int lastditch) | |||||||
| 			sp->ttis[1].tt_isdst = true; | 			sp->ttis[1].tt_isdst = true; | ||||||
| 			sp->ttis[1].tt_abbrind = stdlen + 1; | 			sp->ttis[1].tt_abbrind = stdlen + 1; | ||||||
| 			sp->typecnt = 2; | 			sp->typecnt = 2; | ||||||
|  | 			if (sp == lclptr) | ||||||
|  | 			  { | ||||||
| 			    __gettzinfo ()->__tzrule[0].offset | 			    __gettzinfo ()->__tzrule[0].offset | ||||||
| 						    = -sp->ttis[0].tt_gmtoff; | 						    = -sp->ttis[0].tt_gmtoff; | ||||||
| 			    __gettzinfo ()->__tzrule[1].offset | 			    __gettzinfo ()->__tzrule[1].offset | ||||||
| 						    = -sp->ttis[1].tt_gmtoff; | 						    = -sp->ttis[1].tt_gmtoff; | ||||||
| 			  } | 			  } | ||||||
|  | 		} | ||||||
| 	} else { | 	} else { | ||||||
| 		dstlen = 0; | 		dstlen = 0; | ||||||
| 		sp->typecnt = 1;		/* only standard time */ | 		sp->typecnt = 1;		/* only standard time */ | ||||||
| @@ -1345,9 +1354,12 @@ tzparse(const char *name, struct state *sp, const int lastditch) | |||||||
| 		sp->ttis[0].tt_gmtoff = -stdoffset; | 		sp->ttis[0].tt_gmtoff = -stdoffset; | ||||||
| 		sp->ttis[0].tt_isdst = 0; | 		sp->ttis[0].tt_isdst = 0; | ||||||
| 		sp->ttis[0].tt_abbrind = 0; | 		sp->ttis[0].tt_abbrind = 0; | ||||||
|  | 		if (sp == lclptr) | ||||||
|  | 		  { | ||||||
| 		    __gettzinfo ()->__tzrule[0].offset = -sp->ttis[0].tt_gmtoff; | 		    __gettzinfo ()->__tzrule[0].offset = -sp->ttis[0].tt_gmtoff; | ||||||
| 		    __gettzinfo ()->__tzrule[1].offset = -sp->ttis[0].tt_gmtoff; | 		    __gettzinfo ()->__tzrule[1].offset = -sp->ttis[0].tt_gmtoff; | ||||||
| 		  } | 		  } | ||||||
|  | 	} | ||||||
| 	sp->charcnt = stdlen + 1; | 	sp->charcnt = stdlen + 1; | ||||||
| 	if (dstlen != 0) | 	if (dstlen != 0) | ||||||
| 		sp->charcnt += dstlen + 1; | 		sp->charcnt += dstlen + 1; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user