Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two small patches #104

Merged
merged 2 commits into from
Aug 11, 2022
Merged

Two small patches #104

merged 2 commits into from
Aug 11, 2022

Conversation

nwf-msr
Copy link
Contributor

@nwf-msr nwf-msr commented Jun 28, 2022

One fixes #103 and the other just slightly improves error messages in downstream consumers who mistakenly ask to support writes when opening files.

nwf-msr added 2 commits June 28, 2022 14:45
On platforms with an unsigned char, such as Arm, this results in
always taking error paths around initialization.

Fixes #103
The use of EACCES leads to slightly confusing error messages in
downstream consumers, so prefer EROFS to better articulate what's
actually happening.

While here, use O_RDWR to mask the open flags while testing for
non-RO access.  This is at least encouraged by POSIX with their
suggestion that "O_RDONLY | O_WRONLY == O_RDWR".
@fangfufu fangfufu merged commit 61d3ae4 into fangfufu:master Aug 11, 2022
@fangfufu
Copy link
Owner

Thanks. This is brilliant!

@mkurz
Copy link

mkurz commented Sep 2, 2022

Nice! @fangfufu Would it be possible to release a new version (1.2.4) with that fix included? Need that to run httpdirfs on aarch64 / Asahi Linux on Apple Silicon M1. Thanks!

@fangfufu
Copy link
Owner

fangfufu commented Sep 2, 2022

You can just compile the latest master branch, no? These patches are merged in.

@mkurz
Copy link

mkurz commented Sep 2, 2022

Yeah, I did, kind of, that just now. I am new to Arch Linux and still figuring things out...
I cherry-picked the commits from this pull request on top of the 1.2.3 tag and used that in the Arch PKGBUILD file (I made a fork: https://github.com/mkurz/httpdirfs/releases/tag/1.2.3.1). It worked! I can now use it on my Macbook Pro M1 running Asahi Linux 🥳

@mkurz
Copy link

mkurz commented Sep 2, 2022

(I cherry-picked because I was not sure if the master branch is stable, so I stayed on the 1.2.3 release)

@mkurz
Copy link

mkurz commented Sep 2, 2022

However, a new patch release would still be nice, so the AUR package (https://aur.archlinux.org/packages/httpdirfs) could use it, which would be a much better user experience for arm/aarch64 users (instead of patching by him/herself). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getopt_long returns an int, not a char, and this matters a lot
3 participants