| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 #include "chrome/browser/sync/notifier/base/nethelpers.h" | 6 #include "chrome/common/net/notifier/base/nethelpers.h" |
| 7 | 7 |
| 8 namespace notifier { | 8 namespace notifier { |
| 9 | 9 |
| 10 hostent* SafeGetHostByName(const char* hostname, hostent* host, | 10 hostent* SafeGetHostByName(const char* hostname, hostent* host, |
| 11 char* buffer, size_t buffer_len, | 11 char* buffer, size_t buffer_len, |
| 12 int* herrno) { | 12 int* herrno) { |
| 13 hostent* result = NULL; | 13 hostent* result = NULL; |
| 14 #if WIN32 | 14 #if WIN32 |
| 15 result = gethostbyname(hostname); | 15 result = gethostbyname(hostname); |
| 16 if (!result) { | 16 if (!result) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 34 #elif OS_LINUX | 34 #elif OS_LINUX |
| 35 // No need to free anything, we pass in a pointer to a struct. | 35 // No need to free anything, we pass in a pointer to a struct. |
| 36 #elif OS_MACOSX | 36 #elif OS_MACOSX |
| 37 freehostent(host); | 37 freehostent(host); |
| 38 #else | 38 #else |
| 39 #error "I don't know how to free a hostent on your system." | 39 #error "I don't know how to free a hostent on your system." |
| 40 #endif | 40 #endif |
| 41 } | 41 } |
| 42 | 42 |
| 43 } // namespace notifier | 43 } // namespace notifier |
| OLD | NEW |