Commit 548a7ec
pcp.pmi: fix pmiWrite when sec=0 and usec is omitted
The condition 'if sec and not usec' fails when sec==0 because 0 is
falsy, leaving usec as None and causing pmiWrite2(0, None) to raise
TypeError against its c_int argtypes. Change to 'if usec is None'
so the datetime/float dispatch and the usec=0 fallback always run
when usec was not supplied by the caller.
Add a pmiWrite(0) call at the start of qa/src/test_pmi.python to
cover this path, and update qa/708.out accordingly.
Signed-off-by: Nathan Scott <nathans@redhat.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>1 parent 1ea0b38 commit 548a7ec
3 files changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
55 | 61 | | |
56 | 62 | | |
57 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
389 | | - | |
| 389 | + | |
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
| |||
0 commit comments