This repository has been archived by the owner on Jun 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 118
Move default data directory to XDG_DATA_HOME on Linux #470
Merged
fabiangreffrath
merged 6 commits into
coelckers:master
from
facespkz:linux-new_data_dir-v2
Feb 14, 2022
Merged
Move default data directory to XDG_DATA_HOME on Linux #470
fabiangreffrath
merged 6 commits into
coelckers:master
from
facespkz:linux-new_data_dir-v2
Feb 14, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fabiangreffrath
suggested changes
Feb 13, 2022
fabiangreffrath
suggested changes
Feb 14, 2022
fabiangreffrath
approved these changes
Feb 14, 2022
Thank you! |
Heads up, I think I found a race condition. I don't know how or why it happens, but by all accounts it looks like it shouldn't. |
What exactly do you mean? |
For some reason, maybe 5-10% of the time, the code will return the old path, regardless of if it exists or not. Maybe a bug with the filesystem I'm on, but I just thought it would wait for the |
Hm, you don't check stat()'s return value. On success, it should return 0. If it doesn't return 0, this should be treated just the same as if the directory doesn't exist.
|
After running this about 50 times it looks like it works, so I'll follow this up with another PR. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This takes the current default into account, so it would only be noticeable on a fresh install.
Also a minor refactor for generating the old path.