mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-01 17:47:30 +01:00
openingd: ensure that revents fields are initialized.
Valgrind error file: valgrind-errors.112365 ==112365== Conditional jump or move depends on uninitialised value(s) ==112365== at 0x1105E0: main (openingd.c:1504) ==112365== ==112365== Conditional jump or move depends on uninitialised value(s) ==112365== at 0x110604: main (openingd.c:1507) ==112365== ==112365== Conditional jump or move depends on uninitialised value(s) ==112365== at 0x110628: main (openingd.c:1510) ==112365== Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
e74dfa7fa1
commit
3c9ca5d3e1
1 changed files with 6 additions and 0 deletions
|
@ -1497,6 +1497,12 @@ int main(int argc, char *argv[])
|
|||
t = time_to_msec(trel);
|
||||
else
|
||||
t = -1;
|
||||
|
||||
/*~ If we get a signal which aborts the poll() call, valgrind
|
||||
* complains about revents being uninitialized. I'm not sure
|
||||
* that's correct, but it's easy to be sure. */
|
||||
pollfd[0].revents = pollfd[1].revents = pollfd[2].revents = 0;
|
||||
|
||||
poll(pollfd, ARRAY_SIZE(pollfd), t);
|
||||
/* Subtle: handle_master_in can do its own poll loop, so
|
||||
* don't try to service more than one fd per loop. */
|
||||
|
|
Loading…
Add table
Reference in a new issue