{
sa_family_t family;
union {
+ uint32_t dummy_; /* This field is here so we have something to initialize
+ * with a reliable cross-platform type. */
struct in_addr in_addr;
struct in6_addr in6_addr;
} addr;
uint16_t port;
} tor_addr_port_t;
-#define TOR_ADDR_NULL {AF_UNSPEC, {{0}}};
+#define TOR_ADDR_NULL {AF_UNSPEC, {0}};
static INLINE const struct in6_addr *tor_addr_to_in6(const tor_addr_t *a);
static INLINE uint32_t tor_addr_to_ipv4n(const tor_addr_t *a);
{
process_handle_t *out = tor_malloc_zero(sizeof(process_handle_t));
-#ifndef _WIN32
+#ifdef _WIN32
+ out->stdout_pipe = INVALID_HANDLE_VALUE;
+ out->stderr_pipe = INVALID_HANDLE_VALUE;
+#else
out->stdout_pipe = -1;
out->stderr_pipe = -1;
#endif
#include "di_ops.h"
#include <stdio.h>
#include <stdlib.h>
+#ifdef _WIN32
+/* for the correct alias to struct stat */
+#include <sys/stat.h>
+#endif
#ifndef O_BINARY
#define O_BINARY 0
/** Flag for read_file_to_str: it's okay if the file doesn't exist. */
#define RFTS_IGNORE_MISSING 2
+#ifndef _WIN32
struct stat;
+#endif
char *read_file_to_str(const char *filename, int flags, struct stat *stat_out)
ATTR_MALLOC;
const char *parse_config_line_from_str(const char *line,
* our files during testing. */
static char temp_dir[256];
#ifdef _WIN32
-#define pid_t unsigned
+#define pid_t int
#endif
static pid_t temp_dir_setup_in_pid = 0;
test_assert(process_handle != NULL);
test_eq(expected_status, process_handle->status);
+#ifdef _WIN32
+ test_assert(process_handle->stdout_pipe != INVALID_HANDLE_VALUE);
+ test_assert(process_handle->stderr_pipe != INVALID_HANDLE_VALUE);
+#else
test_assert(process_handle->stdout_pipe > 0);
test_assert(process_handle->stderr_pipe > 0);
+#endif
/* Check stdout */
pos = tor_read_all_from_process_stdout(process_handle, stdout_buf,