Skip to content

Commit

Permalink
[vm/reload] Ensure FileModifiedCallback can handle uris on Windows.
Browse files Browse the repository at this point in the history
Bug: #49634
Change-Id: I65b5c2a0559fdc51c003ffa6e955008850137a1c
TEST=bad_reload_test on Windows
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277044
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
  • Loading branch information
aam authored and Commit Queue committed Dec 21, 2022
1 parent 90b799a commit 8e7b111
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions runtime/bin/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -938,18 +938,18 @@ static void ServiceStreamCancelCallback(const char* stream_id) {
}

static bool FileModifiedCallback(const char* url, int64_t since) {
if (strncmp(url, "file:///", 8) != 0) {
auto path = File::UriToPath(url);
if (path == nullptr) {
// If it isn't a file on local disk, we don't know if it has been
// modified.
return true;
}
int64_t data[File::kStatSize];
File::Stat(NULL, url + 7, data);
File::Stat(NULL, path.get(), data);
if (data[File::kType] == File::kDoesNotExist) {
return true;
}
bool modified = data[File::kModifiedTime] > since;
return modified;
return data[File::kModifiedTime] > since;
}

static void EmbedderInformationCallback(Dart_EmbedderInformation* info) {
Expand Down

0 comments on commit 8e7b111

Please sign in to comment.