nread < 0 means closed
Fixes examples