This commit is contained in:
Matt Johnston 2018-03-03 11:11:04 +08:00
commit 625b38d7af
4 changed files with 6 additions and 5 deletions

View File

@ -9,6 +9,7 @@ void m_burn(void *data, unsigned int len) {
#elif defined(HAVE_EXPLICIT_BZERO) #elif defined(HAVE_EXPLICIT_BZERO)
explicit_bzero(data, len); explicit_bzero(data, len);
#else #else
/* This must be volatile to avoid compiler optimisation */
volatile void *p = data; volatile void *p = data;
memset((void*)p, 0x0, len); memset((void*)p, 0x0, len);
#endif #endif

View File

@ -687,6 +687,6 @@ void fsync_parent_dir(const char* fn) {
TRACE(("error opening directory %s for fsync: %s", dir, strerror(errno))) TRACE(("error opening directory %s for fsync: %s", dir, strerror(errno)))
} }
free(fn_dir); m_free(fn_dir);
#endif #endif
} }

View File

@ -26,7 +26,7 @@ static int wrap_used[IOWRAP_MAXFD+1];
static unsigned int nused; static unsigned int nused;
static unsigned short rand_state[3]; static unsigned short rand_state[3];
void wrapfd_setup() { void wrapfd_setup(void) {
TRACE(("wrapfd_setup")) TRACE(("wrapfd_setup"))
nused = 0; nused = 0;
memset(wrap_fds, 0x0, sizeof(wrap_fds)); memset(wrap_fds, 0x0, sizeof(wrap_fds));

View File

@ -7,10 +7,10 @@ enum wrapfd_mode {
UNUSED = 0, UNUSED = 0,
PLAIN, PLAIN,
INPROGRESS, INPROGRESS,
RANDOMIN, RANDOMIN
}; };
void wrapfd_setup(); void wrapfd_setup(void);
void wrapfd_setseed(uint32_t seed); void wrapfd_setseed(uint32_t seed);
// doesn't take ownership of buf. buf is optional. // doesn't take ownership of buf. buf is optional.
void wrapfd_add(int fd, buffer *buf, enum wrapfd_mode mode); void wrapfd_add(int fd, buffer *buf, enum wrapfd_mode mode);