Chromium Code Reviews| Index: base/files/scoped_file.cc |
| diff --git a/base/files/scoped_file.cc b/base/files/scoped_file.cc |
| index 8ce45b8ba39e5a09ec835bdbc3fd72f735788f4b..c755aa3fd7625679d31b977c0cbf73a14fa08be0 100644 |
| --- a/base/files/scoped_file.cc |
| +++ b/base/files/scoped_file.cc |
| @@ -37,7 +37,10 @@ void ScopedFDCloseTraits::Free(int fd) { |
| int close_errno = errno; |
| base::debug::Alias(&close_errno); |
|
davidben
2017/01/17 22:22:35
We probably can just remove this. I believe we've
|
| - PCHECK(0 == ret); |
| + // NB: Some file descriptors can return errors from close() e.g. network |
| + // filesystems such as NFS and Linux input devices. On Linux, errors from |
| + // close other than EBADF do not indicate failure to actually close the fd. |
| + PCHECK(0 == ret || close_errno != EBADF); |
|
Robert Sesek
2017/01/18 03:54:41
Since this is only a problem on Linux and not othe
|
| } |
| #endif // OS_POSIX |