diff options
author | Matt Johnston <matt@ucc.asn.au> | 2018-02-17 19:29:51 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2018-02-17 19:29:51 +0800 |
commit | 7e8094d53a1c01ac671156ff2e67157b64d01a3a (patch) | |
tree | c88345f5bdd118eb9414dff5ab5c307bb1806c57 /dbutil.c | |
parent | f7a664f127d3dfde0e7c7a9ca74b1d14f9a2f983 (diff) | |
parent | f042eb41ab0d31f8ba0c5ccc9c848ad01f08f986 (diff) |
merge from main
--HG--
branch : fuzz
Diffstat (limited to 'dbutil.c')
-rw-r--r-- | dbutil.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -221,7 +221,7 @@ void dropbear_trace2(const char* format, ...) { #endif /* DEBUG_TRACE */ /* Connect to a given unix socket. The socket is blocking */ -#ifdef ENABLE_CONNECT_UNIX +#if ENABLE_CONNECT_UNIX int connect_unix(const char* path) { struct sockaddr_un addr; int fd = -1; @@ -248,7 +248,7 @@ int connect_unix(const char* path) { * it will be run after the child has fork()ed, and is passed exec_data. * If ret_errfd == NULL then stderr will not be captured. * ret_pid can be passed as NULL to discard the pid. */ -int spawn_command(void(*exec_fn)(void *user_data), void *exec_data, +int spawn_command(void(*exec_fn)(const void *user_data), const void *exec_data, int *ret_writefd, int *ret_readfd, int *ret_errfd, pid_t *ret_pid) { int infds[2]; int outfds[2]; @@ -611,6 +611,10 @@ reach userspace include headers */ #ifndef CLOCK_MONOTONIC_COARSE #define CLOCK_MONOTONIC_COARSE 6 #endif +/* Some old toolchains know SYS_clock_gettime but not CLOCK_MONOTONIC */ +#ifndef CLOCK_MONOTONIC +#define CLOCK_MONOTONIC 1 +#endif static clockid_t get_linux_clock_source() { struct timespec ts; if (syscall(SYS_clock_gettime, CLOCK_MONOTONIC_COARSE, &ts) == 0) { |