Commit 13a8f56
committed
plugins:rtc.c: drop some invalid condition checks
There are some invalid condition checks in rtc.c, when rtc_file is
missing, it should not consider that as a error and return, otherwise,
it can lead to the case that time_set wont be called at all.
With this fix, when both RTC and file restore fail, it will fall back
to call time_set(NULL) and restore time from rtc_timestamp, this
ensures the OS has a valid time at the very first boot.
Signed-off-by: Ming Liu <[email protected]>1 parent 6f6267f commit 13a8f56
1 file changed
+21
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
| 175 | + | |
175 | 176 | | |
176 | 177 | | |
177 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
178 | 182 | | |
179 | 183 | | |
180 | 184 | | |
181 | | - | |
182 | | - | |
183 | 185 | | |
184 | 186 | | |
185 | 187 | | |
186 | 188 | | |
187 | 189 | | |
188 | 190 | | |
189 | 191 | | |
190 | | - | |
| 192 | + | |
| 193 | + | |
191 | 194 | | |
192 | 195 | | |
193 | | - | |
194 | | - | |
| 196 | + | |
| 197 | + | |
195 | 198 | | |
196 | 199 | | |
197 | | - | |
198 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
199 | 210 | | |
200 | | - | |
201 | | - | |
202 | 211 | | |
203 | 212 | | |
204 | 213 | | |
| |||
292 | 301 | | |
293 | 302 | | |
294 | 303 | | |
295 | | - | |
296 | | - | |
| 304 | + | |
297 | 305 | | |
298 | 306 | | |
299 | 307 | | |
| |||
0 commit comments