Commit cae7489
committed
Preserve sub-second precision when converting commandPowerOn timeout
Address review feedback: commandPowerOn previously mapped its
std::chrono::duration<double> argument to timeval via
duration_cast<seconds>, which truncates toward zero, and hardcoded
tv_usec = 0. A caller passing e.g. 2.5 s would silently get a 2 s
read timeout.
Cast to microseconds (the smallest unit timeval can represent) and
split into tv_sec + tv_usec so the fractional portion survives.1 parent 63f1173 commit cae7489
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
248 | 251 | | |
249 | | - | |
250 | | - | |
| 252 | + | |
| 253 | + | |
251 | 254 | | |
252 | 255 | | |
253 | 256 | | |
| |||
0 commit comments