Skip to content

Commit

Permalink
Fixed stat on read-only files for FAT32
Browse files Browse the repository at this point in the history
  • Loading branch information
totalspectrum committed Aug 21, 2023
1 parent 39d90b1 commit 6d97e76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/filesys/fatfs/fatfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ int v_stat(const char *name, struct stat *buf)
return _set_dos_error(r);
}
mode = S_IRUSR | S_IRGRP | S_IROTH;
if (finfo.fattrib & AM_RDO) {
if (!(finfo.fattrib & AM_RDO)) {
mode |= S_IWUSR | S_IWGRP | S_IWOTH;
}
if (finfo.fattrib & AM_DIR) {
Expand Down

0 comments on commit 6d97e76

Please sign in to comment.