• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
Free(HANDLE fd)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 }  // namespace os_unix
31 
32 #endif  // OS_WIN
33 
34 }  // namespace internal
35 }  // namespace fml
36