-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The results of calls to methods write() and read() are now checked in the debug build, which will help diagnose potential problems. Signed-off-by: Aleksandr Golubev <[email protected]>
- Loading branch information
Aleksandr Golubev
committed
Jun 7, 2024
1 parent
7f4f9f1
commit b4abebc
Showing
2 changed files
with
10 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1940,7 +1940,8 @@ static int timer_read(void *opaque) | |
uint64_t count; | ||
|
||
/* Read the count to rearm the periodic timer, but ignore the result */ | ||
(void)read(vdev->timerfd, &count, sizeof(count)); | ||
ssize_t res = read(vdev->timerfd, &count, sizeof(count)); | ||
VHD_ASSERT(res == sizeof(count)); | ||
This comment has been minimized.
Sorry, something went wrong.
den-plotnikov
Contributor
|
||
|
||
elapsed_time(vdev, &elapsed); | ||
|
||
|
I'd rather not mixing fixes: read/write result code checks with variables definition changing. Although the later seems to be legit it's better make a separate patch with a commit message addressing the problem.