Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
1e6f5f01
Commit
1e6f5f01
authored
Oct 26, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs/StandardDirectory: add GetUserRuntimeDir()
parent
225d85fd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
Listen.cxx
src/Listen.cxx
+2
-1
StandardDirectory.cxx
src/fs/StandardDirectory.cxx
+10
-0
StandardDirectory.hxx
src/fs/StandardDirectory.hxx
+7
-0
No files found.
src/Listen.cxx
View file @
1e6f5f01
...
...
@@ -32,6 +32,7 @@
#include "net/SocketUtil.hxx"
#include "system/Error.hxx"
#include "fs/AllocatedPath.hxx"
#include "fs/StandardDirectory.hxx"
#include "fs/XDG.hxx"
#include "util/Domain.hxx"
#include "util/RuntimeError.hxx"
...
...
@@ -85,7 +86,7 @@ ListenXdgRuntimeDir(ClientListener &listener) noexcept
use $XDG_RUNTIME_DIR */
return
false
;
Path
xdg_runtime_dir
=
Path
::
FromFS
(
getenv
(
"XDG_RUNTIME_DIR"
)
);
const
auto
xdg_runtime_dir
=
GetUserRuntimeDir
(
);
if
(
xdg_runtime_dir
.
IsNull
())
return
false
;
...
...
src/fs/StandardDirectory.cxx
View file @
1e6f5f01
...
...
@@ -282,6 +282,16 @@ GetUserCacheDir() noexcept
#endif
}
AllocatedPath
GetUserRuntimeDir
()
noexcept
{
#ifdef USE_XDG
return
SafePathFromFS
(
getenv
(
"XDG_RUNTIME_DIR"
));
#else
return
nullptr
;
#endif
}
#ifdef _WIN32
AllocatedPath
...
...
src/fs/StandardDirectory.hxx
View file @
1e6f5f01
...
...
@@ -43,6 +43,13 @@ GetUserMusicDir() noexcept;
AllocatedPath
GetUserCacheDir
()
noexcept
;
/**
* Obtains the runtime directory for the current user.
*/
[[
gnu
::
const
]]
AllocatedPath
GetUserRuntimeDir
()
noexcept
;
#ifdef _WIN32
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment