~sircmpwn/hare unlisted

ecda8aa72217680be74305deebaba6c5173b72e8 — Umar Getagazov 2 months ago 1849e53
fs::chmod: fix the permission mask

This commit also makes the code a bit more consistent.
1 files changed, 2 insertions(+), 3 deletions(-)

M fs/fs.ha
M fs/fs.ha => fs/fs.ha +2 -3
@@ 30,7 30,7 @@ export fn create(
	mode: mode,
	flags: flags...
) (*io::stream | error) = {
	mode = mode & 0o777;
	mode &= 0o777;
	return match (fs.create) {
		null => errors::unsupported,
		f: *createfunc => f(fs, path, mode, flags...),


@@ 179,8 179,7 @@ export fn mksubdir(fs: *fs, path: str) (*fs | error) = {

// Changes mode flags on a file or directory. Type bits are discared.
export fn chmod(fs: *fs, path: str, mode: mode) (void | error) = {
	mode &= 0o755;

	mode &= 0o777;
	return match (fs.chmod) {
		f: *chmodfunc => f(fs, path, mode),
		null => errors::unsupported,