mirror of
https://github.com/drakmor/ShadowMountPlus.git
synced 2026-10-21 22:22:28 -05:00
Fix silent skips for missing PPR fakelib cleanup targets
This commit is contained in:
1 parent
eba3f11142
commit
3c3bb484c6
1 file changed
+14
-10
+14
-10
@@ -1364,8 +1364,7 @@ static bool cleanup_ppr_backport_fakelib(const char *title_id,
|
||||
int saved_errno = errno;
|
||||
close(backport_fd);
|
||||
if (fakelib_fd < 0) {
|
||||
errno = saved_errno;
|
||||
if (errno == ENOENT)
|
||||
if (saved_errno == ENOENT)
|
||||
return true;
|
||||
log_debug(" [FAKELIB] cannot open PPR fakelib %s/fakelib: %s",
|
||||
backport_path, strerror(saved_errno));
|
||||
@@ -1377,16 +1376,21 @@ static bool cleanup_ppr_backport_fakelib(const char *title_id,
|
||||
"libSceAmpr.sprx", "libScePlayGo.sprx", "libkernel.sprx"};
|
||||
size_t removed = 0;
|
||||
for (size_t i = 0; i < sizeof(filenames) / sizeof(filenames[0]); ++i) {
|
||||
if (unlinkat(fakelib_fd, filenames[i], 0) == 0) {
|
||||
// Skip absent targets before requesting a write on the backing filesystem.
|
||||
struct stat st;
|
||||
if (fstatat(fakelib_fd, filenames[i], &st, AT_SYMLINK_NOFOLLOW) == 0 &&
|
||||
unlinkat(fakelib_fd, filenames[i], 0) == 0) {
|
||||
removed++;
|
||||
} else if (errno != ENOENT) {
|
||||
saved_errno = errno;
|
||||
close(fakelib_fd);
|
||||
log_debug(" [FAKELIB] cannot remove PPR library %s/fakelib/%s: %s",
|
||||
backport_path, filenames[i], strerror(saved_errno));
|
||||
errno = saved_errno;
|
||||
return false;
|
||||
continue;
|
||||
}
|
||||
if (errno == ENOENT)
|
||||
continue;
|
||||
saved_errno = errno;
|
||||
close(fakelib_fd);
|
||||
log_debug(" [FAKELIB] cannot clean up PPR library %s/fakelib/%s: %s",
|
||||
backport_path, filenames[i], strerror(saved_errno));
|
||||
errno = saved_errno;
|
||||
return false;
|
||||
}
|
||||
close(fakelib_fd);
|
||||
if (removed > 0) {
|
||||
|
||||
Reference in new issue
Block a user