From 3b8881b58616fa9b0f54e04071a49cf3ef881058 Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Fri, 2 Oct 2020 10:30:14 +0100 Subject: [PATCH] ipcs: ftruncate is not support on WIN32 https://github.com/microsoft/WSL/issues/902 --- lib/unix.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/unix.c b/lib/unix.c index 5f84cdfca..2fb53d0c6 100644 --- a/lib/unix.c +++ b/lib/unix.c @@ -111,12 +111,15 @@ qb_sys_mmap_file_open(char *path, const char *file, size_t bytes, return res; } +#ifndef _WIN32 + /* ftruncate not supported on WSL + https://github.com/microsoft/WSL/issues/902 */ if (ftruncate(fd, bytes) == -1) { res = -errno; qb_util_perror(LOG_ERR, "couldn't truncate file %s", path); goto unlink_exit; } - +#endif #ifdef HAVE_POSIX_FALLOCATE if ((res = posix_fallocate(fd, 0, bytes)) != 0) { errno = res;