Menu

#4 select() returns -1 in case of errors, not 0

Develop
accepted
Code (2)
Next_Release
1
2018-01-15
2011-03-16
Anonymous
No

I believe line 146 of ttylog.c should be :

  if (retval > 0)

instead of ;
if (retval)

This because under linux "man select" reads "On error, -1 is returned".

On a side note, I also believe that line 137 and 138 of the same file are superfluous, as rfds will be set in the while loop anyway.

Discussion

  • Robert James Clay

    A return of '0' (zero) is also valid but not an error; so while that line may need to be changed, just changing it to '> -0' may not be enough.

    • milestone: v0.2.0 --> v0.2.1
     
  • Robert James Clay

    This will need more investigation.

     
  • Robert James Clay

    • Group: v0.2.0 --> Next_Release
    • Priority: 5 --> 1
    • Milestone: Develop --> v0.26
     
  • Robert James Clay

    • status: open --> accepted
    • Milestone: v0.26 --> Develop
     
  • Robert James Clay

    Note that the 'select' in question is now at line 185 and its associated 'if (retval)' line is still right after it at line 186.

     
  • Robert James Clay

    Note that it is at line 215 now.

     

Log in to post a comment.