anatol / smart.go

Pure-Go library to access drive's S.M.A.R.T. information
MIT License
171 stars 10 forks source link

Fix/file descriptor leak #4

Closed fkocik closed 2 years ago

fkocik commented 2 years ago

Hi,

Thanks very much for this useful library.

I'm using it in a long time running process and observed some file descriptors leak (too many open files errors) after some time. I reduced the error rate with this few fixes.

I'm not sure all the issue conditions are covered but I think it can help ;-)

Regards.

anatol commented 2 years ago

Thank you very much for this contribution. The changes look good.

These changes correlate to each other and essentially fix the same descriptor leakage. Could you please squash the commits into a single one?

fkocik commented 2 years ago

Done.

Thank you for your review.