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

Review code regarding write and the like unsuccessful because interrupted by a signal #212

Open
jnpkrn opened this issue May 12, 2016 · 0 comments

Comments

@jnpkrn
Copy link
Contributor

jnpkrn commented May 12, 2016

E.g., lib/ringbuffer.c:

748 ssize_t                                                                       
749 qb_rb_write_to_file(struct qb_ringbuffer_s * rb, int32_t fd)                  
750 {                                                                             
[...]
760                                                                               
761         /*                                                                    
762          * 1. word_size                                                       
763          */                                                                   
764         result = write(fd, &rb->shared_hdr->word_size, sizeof(uint32_t));     
765         if (result != sizeof(uint32_t)) {                                     
766                 return -errno;                                                
767         }                                                                     
768         written_size += result;                                               

It should be decided for cases when errno == EINTR whether:

  • function should retry autonomously
  • callsites (if any) still within libqb boundary should retry
  • user's code should retry (requires this possibility documented
    properly at the respective libqb functions)
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

No branches or pull requests

1 participant