mirror of
https://github.com/devkitPro/wut.git
synced 2026-08-21 10:04:58 -05:00
coreinit: Add missing parameter to FSChangeMode/FSChangeModeAsync (#199)
This commit is contained in:
@@ -472,6 +472,7 @@ FSChangeMode(FSClient *client,
|
||||
FSCmdBlock *block,
|
||||
char *path,
|
||||
FSMode mode,
|
||||
FSMode modeMask,
|
||||
FSErrorFlag errorMask);
|
||||
|
||||
FSStatus
|
||||
@@ -479,6 +480,7 @@ FSChangeModeAsync(FSClient *client,
|
||||
FSCmdBlock *block,
|
||||
char *path,
|
||||
FSMode mode,
|
||||
FSMode modeMask,
|
||||
FSErrorFlag errorMask,
|
||||
FSAsyncData *asyncData);
|
||||
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
#include <sys/stat.h>
|
||||
#include "devoptab_fs.h"
|
||||
|
||||
static inline FSMode
|
||||
__wut_fs_convert_mode(mode_t mode)
|
||||
{
|
||||
// Convert normal Unix octal permission bits into CafeOS hexadecimal permission bits
|
||||
return (FSMode) (((mode & S_IRWXU) << 2) | ((mode & S_IRWXG) << 1) | (mode & S_IRWXO));
|
||||
}
|
||||
|
||||
int
|
||||
__wut_fs_chmod(struct _reent *r,
|
||||
const char *path,
|
||||
@@ -18,9 +26,11 @@ __wut_fs_chmod(struct _reent *r,
|
||||
return -1;
|
||||
}
|
||||
|
||||
FSMode translatedMode = __wut_fs_convert_mode(mode);
|
||||
|
||||
FSInitCmdBlock(&cmd);
|
||||
status = FSChangeMode(__wut_devoptab_fs_client, &cmd, fixedPath,
|
||||
(FSMode)mode, FS_ERROR_FLAG_ALL);
|
||||
translatedMode, 0x777, FS_ERROR_FLAG_ALL);
|
||||
free(fixedPath);
|
||||
if (status < 0) {
|
||||
r->_errno = __wut_fs_translate_error(status);
|
||||
|
||||
Reference in New Issue
Block a user