Merge pull request #5025 from 0xRickx/fix/libkernel-sys-rename-import
fix(libkernel_sys): reach rename through a _nid_no_patch export
This commit is contained in:
commit
2890f95494
|
|
@ -21,6 +21,7 @@ extern "C" std::filesystem::path ResolvePath_nid_no_patch(const char* path);
|
|||
extern "C" std::filesystem::path RelinkedModulePath_nid_no_patch(const std::filesystem::path& path);
|
||||
extern "C" int SetWorkingDirectory_nid_no_patch(const char* resolved);
|
||||
extern "C" bool FinalPathComponentIsDot_nid_no_patch(const char* path);
|
||||
extern "C" int RenameGuestPath_nid_no_patch(const char* from, const char* to);
|
||||
// Guest path aliases: a guest prefix such as "/savedata0" (a save-data mount point) resolves to a host
|
||||
// directory instead of the run directory; the prefix matches whole path components only.
|
||||
extern "C" void AddPathAlias_nid_no_patch(const char* guestPrefix, const char* hostPath);
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ static int RenamePath_nid_no_patch(const std::filesystem::path& source, const st
|
|||
return error ? FilesystemError(error) : 0;
|
||||
}
|
||||
|
||||
extern "C" int APS5_VABI rename_nid_postfix(const char* from, const char* to) {
|
||||
extern "C" int RenameGuestPath_nid_no_patch(const char* from, const char* to) {
|
||||
if (!from || !to) { errno = 14; return -1; }
|
||||
if (!*from || !*to) { errno = 2; return -1; }
|
||||
try {
|
||||
|
|
@ -83,3 +83,7 @@ extern "C" int APS5_VABI rename_nid_postfix(const char* from, const char* to) {
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" int APS5_VABI rename_nid_postfix(const char* from, const char* to) {
|
||||
return RenameGuestPath_nid_no_patch(from, to);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -544,13 +544,11 @@ int APS5_VABI unlinkat_nid_postfix(int fd, const char* path, int flag) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI rename_nid_postfix(const char* from, const char* to);
|
||||
|
||||
int APS5_VABI renameat_nid_postfix(int oldfd, const char* from, int newfd, const char* to) {
|
||||
if (from == nullptr || to == nullptr) return static_cast<int>(Fail(GuestEfault));
|
||||
if (*from == '\0' || *to == '\0') return static_cast<int>(Fail(GuestEnoent));
|
||||
if ((oldfd == GuestAtFdcwd || *from == '/') && (newfd == GuestAtFdcwd || *to == '/'))
|
||||
return rename_nid_postfix(from, to);
|
||||
return RenameGuestPath_nid_no_patch(from, to);
|
||||
if (std::strlen(from) >= GuestPathMax || HasLongComponent(from) ||
|
||||
std::strlen(to) >= GuestPathMax || HasLongComponent(to))
|
||||
return static_cast<int>(Fail(GuestEnametoolong));
|
||||
|
|
|
|||
Loading…
Reference in New Issue