Skip to content

Commit

Permalink
Merge 370ab69 into d849f91
Browse files Browse the repository at this point in the history
  • Loading branch information
melvinw committed Jan 24, 2023
2 parents d849f91 + 370ab69 commit adf952f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cpp/core.cc
Expand Up @@ -267,13 +267,13 @@ void InitShell() {
gSignalHandler->signal_queue_ = AllocSignalQueue();
}

Tuple2<Str*, int> MakeDirCacheKey(Str* path) {
Tuple2<Str*, int>* MakeDirCacheKey(Str* path) {
struct stat st;
if (::stat(path->data(), &st) == -1) {
throw Alloc<OSError>(errno);
}

return Tuple2<Str*, int>(path, st.st_mtime);
return Alloc<Tuple2<Str*, int>>(path, st.st_mtime);
}

} // namespace pyos
Expand Down
2 changes: 1 addition & 1 deletion cpp/core.h
Expand Up @@ -125,7 +125,7 @@ void SetSigwinchCode(int code);

void InitShell();

Tuple2<Str*, int> MakeDirCacheKey(Str* path);
Tuple2<Str*, int>* MakeDirCacheKey(Str* path);

} // namespace pyos

Expand Down
6 changes: 3 additions & 3 deletions cpp/core_test.cc
Expand Up @@ -286,9 +286,9 @@ TEST dir_cache_key_test() {
struct stat st;
ASSERT(::stat("/", &st) == 0);

Tuple2<Str*, int> key = pyos::MakeDirCacheKey(StrFromC("/"));
ASSERT(str_equals(key.at0(), StrFromC("/")));
ASSERT(key.at1() == st.st_mtime);
Tuple2<Str*, int>* key = pyos::MakeDirCacheKey(StrFromC("/"));
ASSERT(str_equals(key->at0(), StrFromC("/")));
ASSERT(key->at1() == st.st_mtime);

int ec = -1;
try {
Expand Down

0 comments on commit adf952f

Please sign in to comment.