-
Notifications
You must be signed in to change notification settings - Fork 63
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
Conversation
ref #16 |
#define AMQP_CHECK_WRITE_RESULT(expr) \ | ||
({ \ | ||
int _result; \ | ||
do {_result = (expr);} while (_result == -EINTR); \ |
There was a problem hiding this comment.
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; \ |
There was a problem hiding this comment.
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.
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 |
I have checked @alanxz 's version before my change -- he have that fixed already. |
I have another branch https://github.com/j16sdiz/pg_amqp/tree/librabbitmq-0.4 that use 0.4 from upstream. |
No description provided.