1 | // Copyright 2013 The Flutter Authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. |
4 | |
5 | #include "flutter/fml/unique_fd.h" |
6 | |
7 | #include "flutter/fml/eintr_wrapper.h" |
8 | |
9 | namespace fml { |
10 | namespace internal { |
11 | |
12 | #if OS_WIN |
13 | |
14 | namespace os_win { |
15 | |
16 | void UniqueFDTraits::Free(HANDLE fd) { |
17 | CloseHandle(fd); |
18 | } |
19 | |
20 | } // namespace os_win |
21 | |
22 | #else // OS_WIN |
23 | |
24 | namespace os_unix { |
25 | |
26 | void UniqueFDTraits::Free(int fd) { |
27 | close(fd); |
28 | } |
29 | |
30 | void UniqueDirTraits::Free(DIR* dir) { |
31 | closedir(dir); |
32 | } |
33 | |
34 | } // namespace os_unix |
35 | |
36 | #endif // OS_WIN |
37 | |
38 | } // namespace internal |
39 | } // namespace fml |
40 | |