Skip to content

Commit

Permalink
[LibOS] Fix ret variable shadowing in clear_pollable_event()
Browse files Browse the repository at this point in the history
There was a typo that accidentally declared `int ret` in a while-loop
scope and thus shadowed the `ret` variable in the function scope. This
led to the bogus loop (it would always execute only once).

Signed-off-by: jkr0103 <jitender.kumar@intel.com>
  • Loading branch information
jkr0103 authored and dimakuv committed Nov 16, 2023
1 parent d11c5fa commit 2e063d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libos/src/libos_pollable_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ int clear_pollable_event(struct libos_pollable_event* event) {
do {
char buf[0x100];
size_t size = sizeof(buf);
int ret = PalStreamRead(event->read_handle, /*offset=*/0, &size, buf);
ret = PalStreamRead(event->read_handle, /*offset=*/0, &size, buf);
ret = pal_to_unix_errno(ret);
if (ret == 0 && size == 0) {
ret = -EINVAL;
Expand Down

0 comments on commit 2e063d3

Please sign in to comment.