Open
Conversation
Full spec can be found here: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
Owner
|
I like you patch, but I have one concern. If someone is running version before your change and updates |
Owner
|
I mean old running version of |
Author
|
I could try and figure that out during the weekend. |
Contributor
|
You will get an error like this: closing and reopeing your shell or sourcing your rc file fixes that. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Currently, cod's socket and lock file are placed at
$XDG_DATA_DIR/cod/var, which isn't a particularly standard location for them.The XDG Base Directory Specification specifies the locations which various files should be stored at. It states:
It further states a fallback for when the variable isn't set:
This PR changes it so that cod will use
$XDG_RUNTIME_DIR/codfor the socket & lockfile when$XDG_RUNTIME_DIRis set, and will fall back upon$XDG_DATA_DIR/cod/var.Since
$XDG_RUNTIME_DIRhas no default value, falling back upon the old seems like the best choice there.In my experience,
$XDG_RUNTIME_DIRis usually set by pam_systemd, and ends up being set to/run/user/$UID(which it creates it as atmpfs). However, I'd prefer to just go with general spec compliance here.I'm probably not the best with Go programming, but I think this implementation should work fine.