small change - use xdg runtime dir if available instead of home. nicer

in xdg worlds. still falls back tho.



SVN revision: 81858
This commit is contained in:
Carsten Haitzler 2012-12-29 03:39:20 +00:00
parent 2608f68571
commit 717f0823e0
1 changed files with 18 additions and 10 deletions

View File

@ -74,13 +74,17 @@ ecore_con_local_connect(Ecore_Con_Server *svr,
int socket_unix_len;
if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_USER)
{
homedir = getenv("XDG_RUNTIME_DIR");
if (!homedir)
{
homedir = getenv("HOME");
if (!homedir)
{
homedir = getenv("TMP");
if (!homedir)
homedir = "/tmp";
if (!homedir) homedir = "/tmp";
}
}
snprintf(buf, sizeof(buf), "%s/.ecore/%s/%i", homedir, svr->name,
svr->port);
@ -195,13 +199,17 @@ ecore_con_local_listen(
mask = S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH;
if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_USER)
{
homedir = getenv("XDG_RUNTIME_DIR");
if (!homedir)
{
homedir = getenv("HOME");
if (!homedir)
{
homedir = getenv("TMP");
if (!homedir)
homedir = "/tmp";
if (!homedir) homedir = "/tmp";
}
}
mask = S_IRUSR | S_IWUSR | S_IXUSR;
snprintf(buf, sizeof(buf), "%s/.ecore", homedir);