Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

z_mutex_init and other functions returns positive error values [Bug] #358

Closed
milyin opened this issue Feb 28, 2024 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@milyin
Copy link
Contributor

milyin commented Feb 28, 2024

Describe the bug

int8_t zp_mutex_init(zp_mutex_t *m) { return pthread_mutex_init(m, 0); }
int8_t zp_mutex_free(zp_mutex_t *m) { return pthread_mutex_destroy(m); }

The error values returned by pthread_mutex_init can be positive:
https://pubs.opengroup.org/onlinepubs/7908799/xsh/pthread_mutex_init.html
https://github.com/openbsd/src/blob/8700ed7d87c3b82368687dfae3281b306aecbe66/sys/sys/errno.h

But in zenoh c interface it's assumed that error value should always be negative.

To reproduce

System info

@sashacmc
Copy link
Member

sashacmc commented Aug 8, 2024

@milyin please assign it to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants