Skip to content

mq_open return status is set as ERROR#1983

Closed
TaiJuWu wants to merge 1 commit intoapache:masterfrom
TaiJuWu:mq_open_error_code
Closed

mq_open return status is set as ERROR#1983
TaiJuWu wants to merge 1 commit intoapache:masterfrom
TaiJuWu:mq_open_error_code

Conversation

@TaiJuWu
Copy link
Copy Markdown
Contributor

@TaiJuWu TaiJuWu commented Aug 20, 2023

Summary

mq_open return status is set as ERROR instead of -1

Impact

None

Testing

Noe

@pkarashchenko
Copy link
Copy Markdown
Contributor

I do not see any benefit of this change. From application point of view (mqd_t)-1 is more portable

@TaiJuWu
Copy link
Copy Markdown
Contributor Author

TaiJuWu commented Aug 21, 2023

In my mind, error is more intuitive than -1.
If it's not good idea, I will close this PR.
Thank you.

@pkarashchenko
Copy link
Copy Markdown
Contributor

pkarashchenko commented Aug 21, 2023

From POSIX perspective the ERROR is not defined, so from Linux/FreeBSD/OSX/NuttX portability point of view the -1 is better.
I think we can use ERROR in kernel code, but -1 in application if we are talking about POSIX API that define -1 as return value

@TaiJuWu
Copy link
Copy Markdown
Contributor Author

TaiJuWu commented Aug 21, 2023

@pkarashchenko Thank you for your reply.

@TaiJuWu TaiJuWu closed this Aug 21, 2023
@TaiJuWu TaiJuWu deleted the mq_open_error_code branch September 12, 2023 14:29
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.

2 participants