-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Removed call to TryCreateDirectory
from GetDefaultDataDir
in src/util.cpp
.
#7850
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
Conversation
utACK. If there is a good reason for that line to be there on OSX only, then it needs a comment justifying it. |
It seems that this was there as long as GetDefaultDatadir has been there: https://github.com/bitcoin/bitcoin/tree/d882773789ea3894de7163f7bb880c5b23072882/util.cpp |
Looks like this is not for merging... |
?? Sent from my iPhone
|
According to the comment mentioned above, you are only trying if this will work. Your real problem is different though, I think. Can you investigate it a bit more please?
|
@paveljanik The change is for merging. As I said above, if there is a reason for the line to be there it needs to be justified with a comment. |
And I added that the behaviour has been there for as long as the
GetDefaultDatadir function has existed, implying that we'll probably never
find out why.
Concept ACK
|
@sipa yes, but someone should really investigate, how But if proven to work (not just compile ;-), I'm happy with making OS X the same as "Unix" branch there - @alexreg can you please make the OS X branch to directly return the full path and not changing it in two passes (1. add L/A S, 2. add /Bitcoin) and then test with a real user without that directory or with bad permissions on that directory? How will |
But if the data directory has been changed to a different value, the only reason GetDefaultDataDir() is called is to display what the default would have been. (I'm ignoring the slightly more complicated behaviour in -qt). So making sure that (part of) that path exists makes no sense. |
... exist and is writable... |
utACK. |
I’m not sure exactly what you mean. I don’t really code C++. Could you give me the diff please, and I’ll apply it? I’ve already tested both those cases though, and it works as it should.
|
Just |
Oh right. Done now. |
utACK 0f2fd2cec05b90d071b30eb522061e1c5144b367 after squash |
Please squash both commits into one. |
I don’t use Git much, so no idea how to do that.
|
Wladimir explains in #7458, or just do a google search |
…/util.cpp`. See bitcoin#7845 (comment). Also refactored `GetDefaultDataDir` function to return path for Mac in one expression.
utACK 41dbc48 |
ACK 41dbc48 |
Hmm this is indeed weird, why would this need a TryCreateDirectory on OSX. Happy that this solves your problem. utACK 41dbc48 |
…aDir` in `src/util.cpp`. 41dbc48 Removed call to `TryCreateDirectory` from `GetDefaultDataDir` in `src/util.cpp`. (Alexander Regueiro)
I digged in the git history, but could not find something important. But here is the wild guess: on OS X, the config files are in |
Thanks for accepting this, guys. Sent from my iPhone
|
…/util.cpp`. See bitcoin#7845 (comment). Also refactored `GetDefaultDataDir` function to return path for Mac in one expression. Github-Pull: bitcoin#7850 Rebased-From: 41dbc48
Backported as part of #7938. Removing label 'Needs backport'. |
See #7845 (comment).