Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
3793e372
Commit
3793e372
authored
Jul 01, 2006
by
Konstantin Pavlov
Browse files
fix indentation and memory leak introduced in 19564.
do not use vlc_t to store psz_pidfile
parent
ff924dbc
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/main.h
View file @
3793e372
...
...
@@ -92,7 +92,6 @@ struct vlc_t
char
*
psz_homedir
;
/* configuration directory */
char
*
psz_userdir
;
/* user's home directory */
char
*
psz_configfile
;
/* location of config file */
char
*
psz_pidfile
;
/* Fast memcpy plugin used */
module_t
*
p_memcpy_module
;
...
...
src/libvlc.c
View file @
3793e372
...
...
@@ -419,32 +419,33 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
p_vlc
->
p_libvlc
->
b_daemon
=
VLC_TRUE
;
/* lets check if we need to write the pidfile */
p_vlc
->
psz_pidfile
=
config_GetPsz
(
p_vlc
,
"pidfile"
);
msg_Dbg
(
p_vlc
,
"p_vlc->psz_pidfile is %s"
,
p_vlc
->
psz_pidfile
);
if
(
p_vlc
->
psz_pidfile
!=
NULL
)
{
pid_t
i_pid
;
FILE
*
pidfile
;
i_pid
=
getpid
();
msg_Dbg
(
p_vlc
,
"our PID is %d, writing it to %s"
,
i_pid
,
p_vlc
->
psz_pidfile
);
pidfile
=
utf8_fopen
(
p_vlc
->
psz_pidfile
,
"w"
);
if
(
pidfile
!=
NULL
)
{
utf8_fprintf
(
pidfile
,
"%d"
,
(
int
)
i_pid
);
fclose
(
pidfile
);
}
else
{
msg_Err
(
p_vlc
,
"Cannot open pid file for writing: %s, error: %s"
,
p_vlc
->
psz_pidfile
,
strerror
(
errno
)
);
}
/* lets check if we need to write the pidfile */
char
*
psz_pidfile
=
config_GetPsz
(
p_vlc
,
"pidfile"
);
msg_Dbg
(
p_vlc
,
"psz_pidfile is %s"
,
psz_pidfile
);
if
(
psz_pidfile
!=
NULL
)
{
FILE
*
pidfile
;
pid_t
i_pid
=
getpid
();
msg_Dbg
(
p_vlc
,
"our PID is %d, writing it to %s"
,
i_pid
,
psz_pidfile
);
pidfile
=
utf8_fopen
(
psz_pidfile
,
"w"
);
if
(
pidfile
!=
NULL
)
{
utf8_fprintf
(
pidfile
,
"%d"
,
(
int
)
i_pid
);
fclose
(
pidfile
);
}
else
{
msg_Err
(
p_vlc
,
"Cannot open pid file for writing: %s, error: %s"
,
psz_pidfile
,
strerror
(
errno
)
);
}
}
free
(
psz_pidfile
);
#else
pid_t
i_pid
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment