diff options
| author | 2026-03-07 07:14:10 -0600 | |
|---|---|---|
| committer | 2026-03-07 07:14:10 -0600 | |
| commit | 0a0453ff7f9574b4d2fd3cca5a80139b30c28edf (patch) | |
| tree | c33efda6de030f7e5b8e50de4f8798726212f337 | |
| parent | Always 0-initialize EvGenericMessage and add plenty of padding for (diff) | |
Fsync changes.fsync
| -rw-r--r-- | build_win.bat | 8 | ||||
| -rw-r--r-- | src/core/ev.c | 4 | ||||
| -rw-r--r-- | src/core/io.c | 2 | ||||
| -rw-r--r-- | test/suite-io.janet | 2 |
4 files changed, 9 insertions, 7 deletions
diff --git a/build_win.bat b/build_win.bat index e0cfa6eb..6158155c 100644 --- a/build_win.bat +++ b/build_win.bat @@ -29,14 +29,16 @@ if DEFINED CLANG ( @set COMPILER=cl.exe ) if DEFINED SANITIZE ( - @set "SANITIZERS=/fsanitize=address" + @set "SANITIZERS=/fsanitize=address /Zi" + @set "LINK_SAN=/DEBUG" ) else ( @set "SANITIZERS=" + @set "LINK_SAN=/DEBUG" ) @set JANET_COMPILE=%COMPILER% /nologo /Isrc\include /Isrc\conf /c /O2 /W3 /D_CRT_SECURE_NO_WARNINGS /MD %SANITIZERS% -@set JANET_LINK=link /nologo +@set JANET_LINK=link /nologo %LINK_SAN% -@set JANET_LINK_STATIC=lib /nologo +@set JANET_LINK_STATIC=lib /nologo %LINK_SAN% @rem Add janet build tag if not "%JANET_BUILD%" == "" ( diff --git a/src/core/ev.c b/src/core/ev.c index e5239f70..edf767da 100644 --- a/src/core/ev.c +++ b/src/core/ev.c @@ -2262,8 +2262,8 @@ static DWORD WINAPI janet_thread_body(LPVOID ptr) { 0, (LPOVERLAPPED) init); if (!result) { - Janet x = janet_formatv("failed to post completion event: %V", janet_ev_lasterr()); - janet_assert(0, janet_unwrap_string(x)); + JanetString x = janet_formatc("failed to post completion event: %V", janet_ev_lasterr()); + janet_assert(0, (const char *)x); } return 0; } diff --git a/src/core/io.c b/src/core/io.c index cdc7e6bc..f410ca71 100644 --- a/src/core/io.c +++ b/src/core/io.c @@ -331,7 +331,7 @@ JANET_CORE_FN(cfun_io_fsync, janet_panic("file is closed"); #ifdef JANET_WINDOWS { - intptr_t fd = _fileno(iof->file); + int fd = _fileno(iof->file); if (fd < 0) janet_panic("invalid file descriptor"); HANDLE hFile = (HANDLE)_get_osfhandle(fd); diff --git a/test/suite-io.janet b/test/suite-io.janet index cd20c770..0a926074 100644 --- a/test/suite-io.janet +++ b/test/suite-io.janet @@ -78,7 +78,7 @@ (assert-error "cannot print to 3" (xprintf 3 "123")) # file/sync -(with [f (file/temp "wb")] +(with [f (file/temp)] (file/write f "123abc") (file/flush f) (file/sync f)) |
