Skip to content

Conversation

@dNechita
Copy link
Contributor

@dNechita dNechita commented Dec 9, 2024

PR Description

Replace old way of checking pointers returned by iio_create_context().
The pointers returned by iio_create_context() need to be checked with iio_err().

PR Type

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have conducted a self-review of my own code changes
  • I have commented new code, particulary complex or unclear areas
  • I have checked that I did not intoduced new warnings or errors (CI output)
  • I have checked that components that use libiio did not get broken
  • I have updated the documentation accordingly (GitHub Pages, READMEs, etc)

@rgetz
Copy link
Contributor

rgetz commented Jan 8, 2025

if (!ctx) shows up in alot of the other utils - you should try to update everything at the same time...

@dNechita dNechita self-assigned this Jan 9, 2025
@dNechita dNechita force-pushed the fix-stresstest-ctx-check branch from 6dc01c2 to 90bebae Compare January 9, 2025 14:08
@dNechita dNechita changed the title utils: Check the encoded error in the context pointer Check the encoded error in the iio structures for utils and examples Jan 9, 2025
@dNechita
Copy link
Contributor Author

dNechita commented Jan 9, 2025

if (!ctx) shows up in alot of the other utils - you should try to update everything at the same time...

This indeed shows up in alot of other utils but some 'ctx' variables do not come directly from the libiio API (e.g. handle_common_opts() ) and are already checked for an error. I did inspect where each 'ctx' variable comes from and updated things where needed.

@dNechita
Copy link
Contributor Author

dNechita commented Jan 9, 2025

V2:

  • updated code from utils/ and /examples in order to check for encoded error in several iio structures.

Signed-off-by: Dan <dan.nechita@analog.com>
Signed-off-by: Dan Nechita <dan.nechita@analog.com>
@dNechita dNechita force-pushed the fix-stresstest-ctx-check branch from 90bebae to c3cd4a1 Compare January 13, 2025 11:58
@rgetz
Copy link
Contributor

rgetz commented Jan 15, 2025

Thanks for upating - this looks like it also fixes #1048

@cristina-suteu cristina-suteu merged commit 3e76e90 into main Jan 21, 2025
24 checks passed
@cristina-suteu cristina-suteu deleted the fix-stresstest-ctx-check branch January 21, 2025 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants