Brian Silverman | 58899fd | 2019-03-24 11:03:11 -0700 | [diff] [blame] | 1 | #include "aos/scoped/scoped_fd.h" |
| 2 | |
Stephan Pleines | d07111d | 2024-05-30 11:06:05 -0700 | [diff] [blame] | 3 | #include <unistd.h> |
| 4 | |
| 5 | #include <ostream> |
| 6 | |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame^] | 7 | #include "absl/log/check.h" |
| 8 | #include "absl/log/log.h" |
Brian Silverman | 58899fd | 2019-03-24 11:03:11 -0700 | [diff] [blame] | 9 | |
| 10 | namespace aos { |
| 11 | |
| 12 | void ScopedFD::Close() { |
| 13 | if (fd_ != -1) { |
| 14 | if (close(fd_) == -1) { |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 15 | PLOG(WARNING) << "close(" << fd_ << ") failed"; |
Brian Silverman | 58899fd | 2019-03-24 11:03:11 -0700 | [diff] [blame] | 16 | } |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | } // namespace aos |