Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions nob.h
Original file line number Diff line number Diff line change
Expand Up @@ -2373,7 +2373,7 @@ NOBDEF int nob_needs_rebuild(const char *output_path, const char **input_paths,
#ifdef _WIN32
BOOL bSuccess;

HANDLE output_path_fd = CreateFile(output_path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL);
HANDLE output_path_fd = CreateFile(output_path, 0, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL);
if (output_path_fd == INVALID_HANDLE_VALUE) {
// NOTE: if output does not exist it 100% must be rebuilt
if (GetLastError() == ERROR_FILE_NOT_FOUND) return 1;
Expand All @@ -2390,7 +2390,7 @@ NOBDEF int nob_needs_rebuild(const char *output_path, const char **input_paths,

for (size_t i = 0; i < input_paths_count; ++i) {
const char *input_path = input_paths[i];
HANDLE input_path_fd = CreateFile(input_path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL);
HANDLE input_path_fd = CreateFile(input_path, 0, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL);
if (input_path_fd == INVALID_HANDLE_VALUE) {
// NOTE: non-existing input is an error cause it is needed for building in the first place
nob_log(NOB_ERROR, "Could not open file %s: %s", input_path, nob_win32_error_message(GetLastError()));
Expand Down