Skip to content

Commit

Permalink
Merge pull request #239 from radusalagean/master
Browse files Browse the repository at this point in the history
Fix: Use sce_stat->st_mode in io_to_posix_mode (glue.c) so it can also work for files stored in ISOs
  • Loading branch information
fjtrujy authored Oct 24, 2024
2 parents 5aeb5e8 + 3c8302e commit 4a03c90
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/libcglue/glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,11 @@ static time_t psp_to_posix_time(ScePspDateTime psp_time)
static mode_t io_to_posix_mode(SceMode sceMode)
{
mode_t posixmode = 0;
if (sceMode & FIO_SO_IFREG) posixmode |= S_IFREG;
if (sceMode & FIO_SO_IFDIR) posixmode |= S_IFDIR;
if (sceMode & FIO_SO_IROTH) posixmode |= S_IRUSR|S_IRGRP|S_IROTH;
if (sceMode & FIO_SO_IWOTH) posixmode |= S_IWUSR|S_IWGRP|S_IWOTH;
if (sceMode & FIO_SO_IXOTH) posixmode |= S_IXUSR|S_IXGRP|S_IXOTH;
if (sceMode & FIO_S_IFREG) posixmode |= S_IFREG;
if (sceMode & FIO_S_IFDIR) posixmode |= S_IFDIR;
if (sceMode & FIO_S_IROTH) posixmode |= S_IRUSR|S_IRGRP|S_IROTH;
if (sceMode & FIO_S_IWOTH) posixmode |= S_IWUSR|S_IWGRP|S_IWOTH;
if (sceMode & FIO_S_IXOTH) posixmode |= S_IXUSR|S_IXGRP|S_IXOTH;
return posixmode;
}

Expand All @@ -295,7 +295,7 @@ static void __fill_stat(struct stat *stat, const SceIoStat *sce_stat)
{
stat->st_dev = 0;
stat->st_ino = 0;
stat->st_mode = io_to_posix_mode(sce_stat->st_attr);
stat->st_mode = io_to_posix_mode(sce_stat->st_mode);
stat->st_nlink = 0;
stat->st_uid = 0;
stat->st_gid = 0;
Expand Down

0 comments on commit 4a03c90

Please sign in to comment.