Loading src/common/compat.c +0 −11 Original line number Diff line number Diff line Loading @@ -257,17 +257,6 @@ set_max_file_descriptors(rlim_t limit, int *max_out) return 0; } /** Get name of current host and write it to <b>name</b> array, whose * length is specified by <b>namelen</b> argument. Return 0 upon * successful completion; otherwise return return -1. (Currently, * this function is merely a mockable wrapper for POSIX gethostname().) */ MOCK_IMPL(int, tor_gethostname,(char *name, size_t namelen)) { return gethostname(name,namelen); } /** Hold the result of our call to <b>uname</b>. */ static char uname_result[256]; /** True iff uname_result is set. */ Loading src/common/compat.h +0 −2 Original line number Diff line number Diff line Loading @@ -111,8 +111,6 @@ /* ===== Net compatibility */ MOCK_DECL(int,tor_gethostname,(char *name, size_t namelen)); /** Specified SOCKS5 status codes. */ typedef enum { SOCKS5_SUCCEEDED = 0x00, Loading src/common/util.h +0 −1 Original line number Diff line number Diff line Loading @@ -72,7 +72,6 @@ int64_t clamp_double_to_int64(double number); /* String manipulation */ /* Time helpers */ long tv_udiff(const struct timeval *start, const struct timeval *end); long tv_mdiff(const struct timeval *start, const struct timeval *end); Loading src/lib/net/gethostname.c 0 → 100644 +25 −0 Original line number Diff line number Diff line /* Copyright (c) 2003-2004, Roger Dingledine * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson. * Copyright (c) 2007-2018, The Tor Project, Inc. */ /* See LICENSE for licensing information */ #include "orconfig.h" #include "lib/net/gethostname.h" #ifdef HAVE_UNISTD_H #include <unistd.h> #endif #ifdef _WIN32 #include <winsock2.h> #endif /** Get name of current host and write it to <b>name</b> array, whose * length is specified by <b>namelen</b> argument. Return 0 upon * successful completion; otherwise return return -1. (Currently, * this function is merely a mockable wrapper for POSIX gethostname().) */ MOCK_IMPL(int, tor_gethostname,(char *name, size_t namelen)) { return gethostname(name,namelen); } src/lib/net/gethostname.h 0 → 100644 +14 −0 Original line number Diff line number Diff line /* Copyright (c) 2003-2004, Roger Dingledine * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson. * Copyright (c) 2007-2018, The Tor Project, Inc. */ /* See LICENSE for licensing information */ #ifndef TOR_GETHOSTNAME_H #define TOR_GETHOSTNAME_H #include "lib/testsupport/testsupport.h" #include <stddef.h> MOCK_DECL(int,tor_gethostname,(char *name, size_t namelen)); #endif Loading
src/common/compat.c +0 −11 Original line number Diff line number Diff line Loading @@ -257,17 +257,6 @@ set_max_file_descriptors(rlim_t limit, int *max_out) return 0; } /** Get name of current host and write it to <b>name</b> array, whose * length is specified by <b>namelen</b> argument. Return 0 upon * successful completion; otherwise return return -1. (Currently, * this function is merely a mockable wrapper for POSIX gethostname().) */ MOCK_IMPL(int, tor_gethostname,(char *name, size_t namelen)) { return gethostname(name,namelen); } /** Hold the result of our call to <b>uname</b>. */ static char uname_result[256]; /** True iff uname_result is set. */ Loading
src/common/compat.h +0 −2 Original line number Diff line number Diff line Loading @@ -111,8 +111,6 @@ /* ===== Net compatibility */ MOCK_DECL(int,tor_gethostname,(char *name, size_t namelen)); /** Specified SOCKS5 status codes. */ typedef enum { SOCKS5_SUCCEEDED = 0x00, Loading
src/common/util.h +0 −1 Original line number Diff line number Diff line Loading @@ -72,7 +72,6 @@ int64_t clamp_double_to_int64(double number); /* String manipulation */ /* Time helpers */ long tv_udiff(const struct timeval *start, const struct timeval *end); long tv_mdiff(const struct timeval *start, const struct timeval *end); Loading
src/lib/net/gethostname.c 0 → 100644 +25 −0 Original line number Diff line number Diff line /* Copyright (c) 2003-2004, Roger Dingledine * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson. * Copyright (c) 2007-2018, The Tor Project, Inc. */ /* See LICENSE for licensing information */ #include "orconfig.h" #include "lib/net/gethostname.h" #ifdef HAVE_UNISTD_H #include <unistd.h> #endif #ifdef _WIN32 #include <winsock2.h> #endif /** Get name of current host and write it to <b>name</b> array, whose * length is specified by <b>namelen</b> argument. Return 0 upon * successful completion; otherwise return return -1. (Currently, * this function is merely a mockable wrapper for POSIX gethostname().) */ MOCK_IMPL(int, tor_gethostname,(char *name, size_t namelen)) { return gethostname(name,namelen); }
src/lib/net/gethostname.h 0 → 100644 +14 −0 Original line number Diff line number Diff line /* Copyright (c) 2003-2004, Roger Dingledine * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson. * Copyright (c) 2007-2018, The Tor Project, Inc. */ /* See LICENSE for licensing information */ #ifndef TOR_GETHOSTNAME_H #define TOR_GETHOSTNAME_H #include "lib/testsupport/testsupport.h" #include <stddef.h> MOCK_DECL(int,tor_gethostname,(char *name, size_t namelen)); #endif