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

Retry for EINTR (Fix for #16) #17

Closed
wants to merge 1 commit into from

Conversation

j16sdiz
Copy link

@j16sdiz j16sdiz commented Mar 16, 2016

No description provided.

@j16sdiz
Copy link
Author

j16sdiz commented Mar 16, 2016

ref #16

#define AMQP_CHECK_WRITE_RESULT(expr) \
({ \
int _result; \
do {_result = (expr);} while (_result == -EINTR); \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

write(2) will return -1 on error and set errno to EINTR...

I believe that should be

while(-1 == (_result = expr)) && errno == EINTR);

({ \
int _result; \
do {_result = (expr);} while (_result == -EINTR); \
if (_result < 0) return _result; \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is unnecessary as you return result on the next line regardless.

@keithf4
Copy link
Contributor

keithf4 commented Mar 16, 2016

This is also changing the source of an external library we don't maintain

https://github.com/alanxz/rabbitmq-c

Be curious if this issue is handled better in a newer version of that library and we'd be better off trying to see if that could be incorporated. Would also possibly fix another open issue #5

@j16sdiz
Copy link
Author

j16sdiz commented Mar 16, 2016

@keithf4

This is also changing the source of an external library we don't maintain
https://github.com/alanxz/rabbitmq-c

I have checked @alanxz 's version before my change -- he have that fixed already.
but they have too many different that may need to rewrite those glue.

@j16sdiz
Copy link
Author

j16sdiz commented Mar 16, 2016

I have another branch https://github.com/j16sdiz/pg_amqp/tree/librabbitmq-0.4 that use 0.4 from upstream.
It is free of compile error, but I am not confident it would work correctly.

@j16sdiz j16sdiz closed this Mar 16, 2016
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.

3 participants