Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
df9c88b8
Commit
df9c88b8
authored
15 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into conference
parents
05381a13
2cff4a7f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sflphone-common/src/main.cpp
+15
-4
15 additions, 4 deletions
sflphone-common/src/main.cpp
with
15 additions
and
4 deletions
sflphone-common/src/main.cpp
+
15
−
4
View file @
df9c88b8
...
@@ -60,19 +60,20 @@ main (int argc, char **argv)
...
@@ -60,19 +60,20 @@ main (int argc, char **argv)
unsigned
int
iPid
=
getpid
();
unsigned
int
iPid
=
getpid
();
char
cPid
[
64
],
cOldPid
[
64
];
char
cPid
[
64
],
cOldPid
[
64
];
sprintf
(
cPid
,
"%d"
,
iPid
);
sprintf
(
cPid
,
"%d"
,
iPid
);
std
::
string
xdg_c
onfig
,
xdg_env
,
path
;
std
::
string
xdg_c
ache
,
xdg_env
,
path
;
xdg_c
onfig
=
std
::
string
(
HOMEDIR
)
+
DIR_SEPARATOR_STR
+
".cache/
sflphone
"
;
xdg_c
ache
=
std
::
string
(
HOMEDIR
)
+
DIR_SEPARATOR_STR
+
".cache/"
;
if
(
XDG_CACHE_HOME
!=
NULL
)
{
if
(
XDG_CACHE_HOME
!=
NULL
)
{
xdg_env
=
std
::
string
(
XDG_CACHE_HOME
);
xdg_env
=
std
::
string
(
XDG_CACHE_HOME
);
(
xdg_env
.
length
()
>
0
)
?
path
=
xdg_env
(
xdg_env
.
length
()
>
0
)
?
path
=
xdg_env
:
path
=
xdg_c
onfig
;
:
path
=
xdg_c
ache
;
}
else
}
else
path
=
xdg_c
onfig
;
path
=
xdg_c
ache
;
sprintf
(
sfldir
,
"%s"
,
path
.
c_str
());
sprintf
(
sfldir
,
"%s"
,
path
.
c_str
());
path
=
path
+
"sflphone"
;
sprintf
(
homepid
,
"%s/%s"
,
path
.
c_str
(),
PIDFILE
);
sprintf
(
homepid
,
"%s/%s"
,
path
.
c_str
(),
PIDFILE
);
if
(
(
fp
=
fopen
(
homepid
,
"r"
))
==
NULL
)
{
if
(
(
fp
=
fopen
(
homepid
,
"r"
))
==
NULL
)
{
...
@@ -87,6 +88,16 @@ main (int argc, char **argv)
...
@@ -87,6 +88,16 @@ main (int argc, char **argv)
}
}
}
}
// Then create the sflphone directory inside the $XDG_CACHE_HOME dir
sprintf
(
sfldir
,
"%s"
,
path
.
c_str
());
if
(
(
dir
=
opendir
(
sfldir
))
==
NULL
)
{
//Create it
if
(
mkdir
(
sfldir
,
0755
)
!=
0
)
{
fprintf
(
stderr
,
"Creating directory %s failed. Exited.
\n
"
,
sfldir
);
exit
(
-
1
);
}
}
// PID file doesn't exists, create and write pid in it
// PID file doesn't exists, create and write pid in it
if
(
(
fp
=
fopen
(
homepid
,
"w"
))
==
NULL
)
{
if
(
(
fp
=
fopen
(
homepid
,
"w"
))
==
NULL
)
{
fprintf
(
stderr
,
"Creating PID file %s failed. Exited.
\n
"
,
homepid
);
fprintf
(
stderr
,
"Creating PID file %s failed. Exited.
\n
"
,
homepid
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment