mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-11-04 14:00:19 +00:00 
			
		
		
		
	efi_loader: handling of daylight saving time
If SetTime() is meant to set daylight saving time it will be called with Time.Daylight == EFI_TIME_ADJUST_DAYLIGHT | EFI_TIME_IN_DAYLIGHT. Return 0 from GetTime() if time is not in daylight because we cannot determine if we are in a time zone with daylight saving time. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
		
							parent
							
								
									656f17106b
								
							
						
					
					
						commit
						38b9a79c63
					
				@ -195,9 +195,9 @@ static efi_status_t EFIAPI efi_get_time_boottime(
 | 
				
			|||||||
	time->hour = tm.tm_hour;
 | 
						time->hour = tm.tm_hour;
 | 
				
			||||||
	time->minute = tm.tm_min;
 | 
						time->minute = tm.tm_min;
 | 
				
			||||||
	time->second = tm.tm_sec;
 | 
						time->second = tm.tm_sec;
 | 
				
			||||||
	time->daylight = EFI_TIME_ADJUST_DAYLIGHT;
 | 
						if (tm.tm_isdst)
 | 
				
			||||||
	if (tm.tm_isdst > 0)
 | 
							time->daylight =
 | 
				
			||||||
		time->daylight |= EFI_TIME_IN_DAYLIGHT;
 | 
								EFI_TIME_ADJUST_DAYLIGHT | EFI_TIME_IN_DAYLIGHT;
 | 
				
			||||||
	time->timezone = EFI_UNSPECIFIED_TIMEZONE;
 | 
						time->timezone = EFI_UNSPECIFIED_TIMEZONE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (capabilities) {
 | 
						if (capabilities) {
 | 
				
			||||||
@ -276,7 +276,8 @@ static efi_status_t EFIAPI efi_set_time_boottime(struct efi_time *time)
 | 
				
			|||||||
	tm.tm_hour = time->hour;
 | 
						tm.tm_hour = time->hour;
 | 
				
			||||||
	tm.tm_min = time->minute;
 | 
						tm.tm_min = time->minute;
 | 
				
			||||||
	tm.tm_sec = time->second;
 | 
						tm.tm_sec = time->second;
 | 
				
			||||||
	tm.tm_isdst = time->daylight == EFI_TIME_IN_DAYLIGHT;
 | 
						tm.tm_isdst = time->daylight ==
 | 
				
			||||||
 | 
							      (EFI_TIME_ADJUST_DAYLIGHT | EFI_TIME_IN_DAYLIGHT);
 | 
				
			||||||
	/* Calculate day of week */
 | 
						/* Calculate day of week */
 | 
				
			||||||
	rtc_calc_weekday(&tm);
 | 
						rtc_calc_weekday(&tm);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user