Skip to content

Commit

Permalink
always use the alloc version
Browse files Browse the repository at this point in the history
  • Loading branch information
maminrayej committed Nov 7, 2024
1 parent 05220fc commit d39af6c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libc-bottom-half/headers/public/wasi/libc-find-relpath.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ int __wasilibc_find_relpath_alloc(
char **relative,
size_t *relative_len,
int can_realloc
) __attribute__((__weak__));
);

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion libc-bottom-half/sources/posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static int find_relpath2(
) {
// See comments in `preopens.c` for what this trick is doing.
const char *abs;
if (__wasilibc_find_relpath_alloc)
if (&__wasilibc_find_relpath_alloc)
return __wasilibc_find_relpath_alloc(path, &abs, relative, relative_len, 1);
return __wasilibc_find_relpath(path, &abs, relative, *relative_len);
}
Expand Down
2 changes: 1 addition & 1 deletion libc-bottom-half/sources/preopens.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ int __wasilibc_find_relpath(const char *path,
// If `chdir` is linked, whose object file defines this symbol, then we
// call that. Otherwise if the program can't `chdir` then `path` is
// absolute (or relative to the root dir), so we delegate to `find_abspath`
if (__wasilibc_find_relpath_alloc)
if (&__wasilibc_find_relpath_alloc)
return __wasilibc_find_relpath_alloc(path, abs_prefix, relative_path, &relative_path_len, 0);
return __wasilibc_find_abspath(path, abs_prefix, (const char**) relative_path);
}
Expand Down

0 comments on commit d39af6c

Please sign in to comment.