diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-04-13 16:17:12 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-13 16:17:12 -0400 |
| commit | 4a2ccd6fb811f044932cd660d1bee67c8664d483 (patch) | |
| tree | fce717d3b80052fbd64cf0bec9f93d622821e3c8 /src/os.cpp | |
| parent | 9d229791c68827f8890f0715dc05e3380693645d (diff) | |
| parent | 93e89b3b7efeaa41f4f11fbb022b962d2244dab2 (diff) | |
| download | zig-4a2ccd6fb811f044932cd660d1bee67c8664d483.tar.gz zig-4a2ccd6fb811f044932cd660d1bee67c8664d483.zip | |
Merge pull request #2266 from bnoordhuis/fix-cache-lseek-ebadf
don't close cache manifest file prematurely
Diffstat (limited to 'src/os.cpp')
| -rw-r--r-- | src/os.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/os.cpp b/src/os.cpp index 470d222307..60c66908cc 100644 --- a/src/os.cpp +++ b/src/os.cpp @@ -2081,11 +2081,13 @@ Error os_file_overwrite(OsFile file, Buf *contents) { #endif } -void os_file_close(OsFile file) { +void os_file_close(OsFile *file) { #if defined(ZIG_OS_WINDOWS) - CloseHandle(file); + CloseHandle(*file); + *file = NULL; #else - close(file); + close(*file); + *file = -1; #endif } |
