| Index: base/file_util.h
|
| diff --git a/base/file_util.h b/base/file_util.h
|
| index 9eb172916b5fca69d8be94507465d000e7d9fede..543a86c7779d608c39aabe8cc6d9ddbcff7d283d 100644
|
| --- a/base/file_util.h
|
| +++ b/base/file_util.h
|
| @@ -371,6 +371,20 @@ class ScopedFILEClose {
|
|
|
| typedef scoped_ptr_malloc<FILE, ScopedFILEClose> ScopedFILE;
|
|
|
| +#if defined(OS_POSIX)
|
| +// A class to handle auto-closing of FDs.
|
| +class ScopedFDClose {
|
| + public:
|
| + inline void operator()(int* x) const {
|
| + if (x) {
|
| + close(*x);
|
| + }
|
| + }
|
| +};
|
| +
|
| +typedef scoped_ptr_malloc<int, ScopedFDClose> ScopedFD;
|
| +#endif // OS_POSIX
|
| +
|
| // A class for enumerating the files in a provided path. The order of the
|
| // results is not guaranteed.
|
| //
|
|
|