|
@@ -88,12 +88,12 @@ SecureZeroMemory(PVOID ptr, SIZE_T cnt)
|
|
|
while (cnt--)
|
|
|
*vcptr++ = 0;
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
#elif defined(HAVE_READPASSPHRASE_H)
|
|
|
#include <readpassphrase.h>
|
|
|
#else
|
|
|
#include "tor_readpassphrase.h"
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
#if defined(HAVE_SYS_PRCTL_H) && defined(__linux__)
|
|
@@ -102,7 +102,7 @@ SecureZeroMemory(PVOID ptr, SIZE_T cnt)
|
|
|
#elif defined(__APPLE__)
|
|
|
#include <sys/types.h>
|
|
|
#include <sys/ptrace.h>
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
#ifdef HAVE_NETDB_H
|
|
|
#include <netdb.h>
|
|
@@ -161,7 +161,7 @@ tor_open_cloexec(const char *path, int flags, unsigned mode)
|
|
|
* are running on one without. */
|
|
|
if (errno != EINVAL)
|
|
|
return -1;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
log_debug(LD_FS, "Opening %s with flags %x", p, flags);
|
|
|
fd = open(p, flags, mode);
|
|
@@ -173,7 +173,7 @@ tor_open_cloexec(const char *path, int flags, unsigned mode)
|
|
|
return -1;
|
|
|
}
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
return fd;
|
|
|
}
|
|
|
|
|
@@ -191,7 +191,7 @@ tor_fopen_cloexec(const char *path, const char *mode)
|
|
|
return NULL;
|
|
|
}
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -451,7 +451,7 @@ tor_munmap_file(tor_mmap_t *handle)
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
* ways: First, always NUL-terminates its output. Second, always
|
|
@@ -591,7 +591,7 @@ tor_vasprintf(char **strp, const char *fmt, va_list args)
|
|
|
}
|
|
|
*strp = strp_tmp;
|
|
|
return len;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
|
|
@@ -637,7 +637,7 @@ tor_memmem(const void *_haystack, size_t hlen,
|
|
|
}
|
|
|
}
|
|
|
return NULL;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
|
|
@@ -775,7 +775,7 @@ tor_fix_source_file(const char *fname)
|
|
|
}
|
|
|
return r;
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
* Read a 16-bit value beginning at <b>cp</b>. Equivalent to
|
|
@@ -869,7 +869,7 @@ replace_file(const char *from, const char *to)
|
|
|
return -1;
|
|
|
}
|
|
|
return tor_rename(from,to);
|
|
|
-#endif
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
|
|
@@ -955,7 +955,7 @@ tor_lockfile_lock(const char *filename, int blocking, int *locked_out)
|
|
|
return NULL;
|
|
|
}
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
result = tor_malloc(sizeof(tor_lockfile_t));
|
|
|
result->filename = tor_strdup(filename);
|
|
@@ -983,7 +983,7 @@ tor_lockfile_unlock(tor_lockfile_t *lockfile)
|
|
|
}
|
|
|
#else
|
|
|
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
close(lockfile->fd);
|
|
|
lockfile->fd = -1;
|
|
@@ -1031,9 +1031,9 @@ tor_fd_seekend(int fd)
|
|
|
* no need to worry. */
|
|
|
if (rc < 0 && errno == ESPIPE)
|
|
|
rc = 0;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
return (rc < 0) ? -1 : 0;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1072,7 +1072,7 @@ tor_ftruncate(int fd)
|
|
|
static bitarray_t *open_sockets = NULL;
|
|
|
|
|
|
static int max_socket = -1;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
* eventdns and libevent.) */
|
|
@@ -1142,7 +1142,7 @@ tor_close_socket,(tor_socket_t s))
|
|
|
tor_assert(open_sockets && s <= max_socket);
|
|
|
bitarray_clear(open_sockets, s);
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
if (r == 0) {
|
|
|
--n_sockets_open;
|
|
|
} else {
|
|
@@ -1152,7 +1152,7 @@ tor_close_socket,(tor_socket_t s))
|
|
|
#else
|
|
|
if (r != EBADF)
|
|
|
--n_sockets_open;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
r = -1;
|
|
|
}
|
|
|
|
|
@@ -1185,9 +1185,9 @@ mark_socket_open(tor_socket_t s)
|
|
|
}
|
|
|
bitarray_set(open_sockets, s);
|
|
|
}
|
|
|
-#else
|
|
|
+#else
|
|
|
#define mark_socket_open(s) STMT_NIL
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
|
@@ -1245,7 +1245,7 @@ tor_open_socket_with_extensions(int domain, int type, int protocol,
|
|
|
* support, we are running on one without. */
|
|
|
if (errno != EINVAL)
|
|
|
return s;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
s = socket(domain, type, protocol);
|
|
|
if (! SOCKET_OK(s))
|
|
@@ -1259,9 +1259,9 @@ tor_open_socket_with_extensions(int domain, int type, int protocol,
|
|
|
return TOR_INVALID_SOCKET;
|
|
|
}
|
|
|
}
|
|
|
-#else
|
|
|
+#else
|
|
|
(void)cloexec;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
if (nonblock) {
|
|
|
if (set_socket_nonblocking(s) == -1) {
|
|
@@ -1330,7 +1330,7 @@ tor_accept_socket_with_extensions(tor_socket_t sockfd, struct sockaddr *addr,
|
|
|
* we are missing SOCK_CLOEXEC/SOCK_NONBLOCK support. */
|
|
|
if (errno != EINVAL && errno != ENOSYS)
|
|
|
return s;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
s = accept(sockfd, addr, len);
|
|
|
if (!SOCKET_OK(s))
|
|
@@ -1344,9 +1344,9 @@ tor_accept_socket_with_extensions(tor_socket_t sockfd, struct sockaddr *addr,
|
|
|
return TOR_INVALID_SOCKET;
|
|
|
}
|
|
|
}
|
|
|
-#else
|
|
|
+#else
|
|
|
(void)cloexec;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
if (nonblock) {
|
|
|
if (set_socket_nonblocking(s) == -1) {
|
|
@@ -1406,7 +1406,7 @@ set_socket_nonblocking(tor_socket_t sock)
|
|
|
log_warn(LD_NET, "Couldn't set file status flags: %s", strerror(errno));
|
|
|
return -1;
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -1444,7 +1444,7 @@ tor_socketpair(int family, int type, int protocol, tor_socket_t fd[2])
|
|
|
* are running on one without. */
|
|
|
if (errno != EINVAL)
|
|
|
return -errno;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
r = socketpair(family, type, protocol, fd);
|
|
|
if (r < 0)
|
|
@@ -1467,7 +1467,7 @@ tor_socketpair(int family, int type, int protocol, tor_socket_t fd[2])
|
|
|
return -errno;
|
|
|
}
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
goto sockets_ok;
|
|
|
|
|
|
sockets_ok:
|
|
@@ -1483,9 +1483,9 @@ tor_socketpair(int family, int type, int protocol, tor_socket_t fd[2])
|
|
|
socket_accounting_unlock();
|
|
|
|
|
|
return 0;
|
|
|
-#else
|
|
|
+#else
|
|
|
return tor_ersatz_socketpair(family, type, protocol, fd);
|
|
|
-#endif
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
#ifdef NEED_ERSATZ_SOCKETPAIR
|
|
@@ -1642,7 +1642,7 @@ tor_ersatz_socketpair(int family, int type, int protocol, tor_socket_t fd[2])
|
|
|
|
|
|
#undef SIZEOF_SOCKADDR
|
|
|
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
int
|
|
@@ -1696,7 +1696,7 @@ set_max_file_descriptors(rlim_t limit, int *max_out)
|
|
|
#else
|
|
|
const char *platform = "unknown platforms with no getrlimit()";
|
|
|
const unsigned long MAX_CONNECTIONS = 15000;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
log_fn(LOG_INFO, LD_NET,
|
|
|
"This platform is missing getrlimit(). Proceeding.");
|
|
|
if (limit > MAX_CONNECTIONS) {
|
|
@@ -1707,7 +1707,7 @@ set_max_file_descriptors(rlim_t limit, int *max_out)
|
|
|
return -1;
|
|
|
}
|
|
|
limit = MAX_CONNECTIONS;
|
|
|
-#else
|
|
|
+#else
|
|
|
struct rlimit rlim;
|
|
|
|
|
|
if (getrlimit(RLIMIT_NOFILE, &rlim) != 0) {
|
|
@@ -1756,7 +1756,7 @@ set_max_file_descriptors(rlim_t limit, int *max_out)
|
|
|
bad = 0;
|
|
|
}
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
if (bad) {
|
|
|
log_warn(LD_CONFIG,"Couldn't set maximum number of file descriptors: %s",
|
|
|
strerror(errno));
|
|
@@ -1765,7 +1765,7 @@ set_max_file_descriptors(rlim_t limit, int *max_out)
|
|
|
}
|
|
|
|
|
|
limit = rlim.rlim_cur;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
if (limit > INT_MAX)
|
|
|
limit = INT_MAX;
|
|
@@ -1803,7 +1803,7 @@ log_credential_status(void)
|
|
|
"UID is %u (real), %u (effective), %u (saved)",
|
|
|
(unsigned)ruid, (unsigned)euid, (unsigned)suid);
|
|
|
}
|
|
|
-#else
|
|
|
+#else
|
|
|
|
|
|
ruid = getuid();
|
|
|
euid = geteuid();
|
|
@@ -1812,7 +1812,7 @@ log_credential_status(void)
|
|
|
log_fn(CREDENTIAL_LOG_LEVEL, LD_GENERAL,
|
|
|
"UID is %u (real), %u (effective), unknown (saved)",
|
|
|
(unsigned)ruid, (unsigned)euid);
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
#ifdef HAVE_GETRESGID
|
|
@@ -1824,7 +1824,7 @@ log_credential_status(void)
|
|
|
"GID is %u (real), %u (effective), %u (saved)",
|
|
|
(unsigned)rgid, (unsigned)egid, (unsigned)sgid);
|
|
|
}
|
|
|
-#else
|
|
|
+#else
|
|
|
|
|
|
rgid = getgid();
|
|
|
egid = getegid();
|
|
@@ -1832,7 +1832,7 @@ log_credential_status(void)
|
|
|
log_fn(CREDENTIAL_LOG_LEVEL, LD_GENERAL,
|
|
|
"GID is %u (real), %u (effective), unknown (saved)",
|
|
|
(unsigned)rgid, (unsigned)egid);
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
sup_gids_size = 64;
|
|
@@ -1872,7 +1872,7 @@ log_credential_status(void)
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
#ifndef _WIN32
|
|
|
|
|
@@ -1972,7 +1972,7 @@ tor_getpwuid(uid_t uid)
|
|
|
|
|
|
return NULL;
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
* seem to work. **/
|
|
@@ -1985,9 +1985,9 @@ have_capability_support(void)
|
|
|
return 0;
|
|
|
cap_free(caps);
|
|
|
return 1;
|
|
|
-#else
|
|
|
+#else
|
|
|
return 0;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
#ifdef HAVE_LINUX_CAPABILITIES
|
|
@@ -2046,7 +2046,7 @@ drop_capabilities(int pre_setuid)
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
* primary group. Return 0 on success. On failure, log and return -1.
|
|
@@ -2096,13 +2096,13 @@ switch_id(const char *user, const unsigned flags)
|
|
|
if (drop_capabilities(1))
|
|
|
return -1;
|
|
|
}
|
|
|
-#else
|
|
|
+#else
|
|
|
(void) keep_bindlow;
|
|
|
if (warn_if_no_caps) {
|
|
|
log_warn(LD_CONFIG, "KeepBindCapabilities set, but no capability support "
|
|
|
"on this system.");
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
if (setgroups(1, &pw->pw_gid)) {
|
|
@@ -2162,7 +2162,7 @@ switch_id(const char *user, const unsigned flags)
|
|
|
if (drop_capabilities(0))
|
|
|
return -1;
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
#if !defined(CYGWIN) && !defined(__CYGWIN__)
|
|
|
|
|
@@ -2186,7 +2186,7 @@ switch_id(const char *user, const unsigned flags)
|
|
|
return -1;
|
|
|
}
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
if (log_credential_status()) {
|
|
@@ -2204,16 +2204,16 @@ switch_id(const char *user, const unsigned flags)
|
|
|
log_warn(LD_CONFIG, "Unable to re-enable coredumps: %s",strerror(errno));
|
|
|
}
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
return 0;
|
|
|
|
|
|
-#else
|
|
|
+#else
|
|
|
(void)user;
|
|
|
(void)flags;
|
|
|
|
|
|
log_warn(LD_CONFIG, "Switching users is unsupported on your OS.");
|
|
|
return -1;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
|
|
@@ -2252,7 +2252,7 @@ tor_disable_debugger_attach(void)
|
|
|
attempted = 1;
|
|
|
r = ptrace(PT_DENY_ATTACH, 0, 0, 0);
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
|
@@ -2282,7 +2282,7 @@ get_user_homedir(const char *username)
|
|
|
}
|
|
|
return tor_strdup(pw->pw_dir);
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
* actually examine the filesystem; does a purely syntactic modification.
|
|
@@ -2310,7 +2310,7 @@ get_parent_directory(char *fname)
|
|
|
if (fname[0] && fname[1] == ':') {
|
|
|
fname += 2;
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
* and to remove the end of the string starting with the path separator
|
|
|
* before the last non-path-separator. In perl, this would be
|
|
@@ -2359,7 +2359,7 @@ alloc_getcwd(void)
|
|
|
raw_free(cwd);
|
|
|
}
|
|
|
return result;
|
|
|
-#else
|
|
|
+#else
|
|
|
size_t size = 1024;
|
|
|
char *buf = NULL;
|
|
|
char *ptr = NULL;
|
|
@@ -2376,9 +2376,9 @@ alloc_getcwd(void)
|
|
|
size *= 2;
|
|
|
}
|
|
|
return buf;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
* Return a newly allocated string, possibly equal to <b>fname</b>. */
|
|
@@ -2394,7 +2394,7 @@ make_path_absolute(char *fname)
|
|
|
if (absfname_malloced) raw_free(absfname_malloced);
|
|
|
|
|
|
return absfname;
|
|
|
-#else
|
|
|
+#else
|
|
|
char *absfname = NULL, *path = NULL;
|
|
|
|
|
|
tor_assert(fname);
|
|
@@ -2417,7 +2417,7 @@ make_path_absolute(char *fname)
|
|
|
}
|
|
|
}
|
|
|
return absfname;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
#ifndef HAVE__NSGETENVIRON
|
|
@@ -2426,8 +2426,8 @@ make_path_absolute(char *fname)
|
|
|
#ifndef RUNNING_DOXYGEN
|
|
|
extern char **environ;
|
|
|
#endif
|
|
|
-#endif
|
|
|
-#endif
|
|
|
+#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
* 'environ'. */
|
|
@@ -2439,9 +2439,9 @@ get_environment(void)
|
|
|
* when we do a mostly-static build on OSX 10.7, the resulting binary won't
|
|
|
* work on OSX 10.6. */
|
|
|
return *_NSGetEnviron();
|
|
|
-#else
|
|
|
+#else
|
|
|
return environ;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
|
|
@@ -2718,7 +2718,7 @@ get_uname,(void))
|
|
|
|
|
|
strlcpy(uname_result, u.sysname, sizeof(uname_result));
|
|
|
} else
|
|
|
-#endif
|
|
|
+#endif
|
|
|
{
|
|
|
#ifdef _WIN32
|
|
|
OSVERSIONINFOEX info;
|
|
@@ -2780,12 +2780,12 @@ get_uname,(void))
|
|
|
info.wProductType == VER_NT_DOMAIN_CONTROLLER) {
|
|
|
strlcat(uname_result, " [server]", sizeof(uname_result));
|
|
|
}
|
|
|
-#endif
|
|
|
-#else
|
|
|
+#endif
|
|
|
+#else
|
|
|
|
|
|
strlcpy(uname_result, "Unknown platform", sizeof(uname_result));
|
|
|
|
|
|
-#endif
|
|
|
+#endif
|
|
|
}
|
|
|
uname_result_is_set = 1;
|
|
|
}
|
|
@@ -2841,7 +2841,7 @@ compute_num_cpus_impl(void)
|
|
|
return -1;
|
|
|
#else
|
|
|
return -1;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
#define MAX_DETECTABLE_CPUS 16
|
|
@@ -3004,7 +3004,7 @@ tor_localtime_r(const time_t *timep, struct tm *result)
|
|
|
memcpy(result, r, sizeof(struct tm));
|
|
|
return correct_tm(1, timep, result, r);
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
|
@@ -3047,7 +3047,7 @@ tor_gmtime_r(const time_t *timep, struct tm *result)
|
|
|
memcpy(result, r, sizeof(struct tm));
|
|
|
return correct_tm(0, timep, result, r);
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
#if defined(HAVE_MLOCKALL) && HAVE_DECL_MLOCKALL && defined(RLIMIT_MEMLOCK)
|
|
|
#define HAVE_UNIX_MLOCKALL
|
|
@@ -3084,7 +3084,7 @@ tor_set_max_memlock(void)
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
* This should only be called once and while we're privileged.
|
|
@@ -3130,10 +3130,10 @@ tor_mlockall(void)
|
|
|
"pages: %s", strerror(errno));
|
|
|
return -1;
|
|
|
}
|
|
|
-#else
|
|
|
+#else
|
|
|
log_warn(LD_GENERAL, "Unable to lock memory pages. mlockall() unsupported?");
|
|
|
return -1;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
|
|
@@ -3161,7 +3161,7 @@ tor_socket_errno(tor_socket_t sock)
|
|
|
}
|
|
|
return err;
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
#if defined(_WIN32)
|
|
|
#define E(code, s) { code, (s " [" #code " ]") }
|
|
@@ -3237,7 +3237,7 @@ tor_socket_strerror(int e)
|
|
|
}
|
|
|
return strerror(e);
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
* (Some operating systems require their network libraries to be
|
|
@@ -3263,7 +3263,7 @@ network_init(void)
|
|
|
|
|
|
* We might use it to complain if we're trying to be a server but have
|
|
|
* too few sockets available. */
|
|
|
-#endif
|
|
|
+#endif
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -3299,9 +3299,9 @@ format_win32_error(DWORD err)
|
|
|
result = tor_malloc(len);
|
|
|
wcstombs(result,str,len);
|
|
|
result[len-1] = '\0';
|
|
|
-#else
|
|
|
+#else
|
|
|
result = tor_strdup(str);
|
|
|
-#endif
|
|
|
+#endif
|
|
|
} else {
|
|
|
result = tor_strdup("<unformattable error>");
|
|
|
}
|
|
@@ -3310,7 +3310,7 @@ format_win32_error(DWORD err)
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
#if defined(HW_PHYSMEM64)
|
|
|
|
|
@@ -3318,7 +3318,7 @@ format_win32_error(DWORD err)
|
|
|
#elif defined(HW_MEMSIZE)
|
|
|
|
|
|
#define INT64_HW_MEM HW_MEMSIZE
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
* Helper: try to detect the total system memory, and return it. On failure,
|
|
@@ -3392,7 +3392,7 @@ get_total_system_memory_impl(void)
|
|
|
#else
|
|
|
|
|
|
return 0;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
|
|
@@ -3425,7 +3425,7 @@ get_total_system_memory(size_t *mem_out)
|
|
|
* size_t. */
|
|
|
m = SIZE_MAX;
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
*mem_out = mem_cached = (size_t) m;
|
|
|
|
|
@@ -3506,7 +3506,7 @@ tor_getpass(const char *prompt, char *output, size_t buflen)
|
|
|
return r;
|
|
|
#else
|
|
|
#error "No implementation for tor_getpass found!"
|
|
|
-#endif
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
|
|
@@ -3546,6 +3546,6 @@ tor_get_avail_disk_space(const char *path)
|
|
|
(void)path;
|
|
|
errno = ENOSYS;
|
|
|
return -1;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
}
|
|
|
|