Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
98ade156
Commit
98ade156
authored
Apr 01, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inline SaveConfigFile()
parent
5eeeb50d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
26 deletions
+8
-26
src/config/file.c
src/config/file.c
+8
-26
No files found.
src/config/file.c
View file @
98ade156
...
...
@@ -341,24 +341,12 @@ static int config_PrepareDir (vlc_object_t *obj)
return
ret
;
}
/*****************************************************************************
* config_SaveConfigFile: Save a module's config options.
*****************************************************************************
* It's no use to save the config options that kept their default values, so
* we'll try to be a bit clever here.
*
* When we save we mustn't delete the config options of the modules that
* haven't been loaded. So we cannot just create a new config file with the
* config structures we've got in memory.
* I don't really know how to deal with this nicely, so I will use a completly
* dumb method ;-)
* I will load the config file in memory, but skipping all the sections of the
* modules we want to save. Then I will create a brand new file, dump the file
* loaded in memory and then append the sections of the modules we want to
* save.
* Really stupid no ?
*****************************************************************************/
static
int
SaveConfigFile
(
vlc_object_t
*
p_this
)
#undef config_SaveConfigFile
/**
* Saves the in-memory configuration into a file.
* @return 0 on success, -1 on error.
*/
int
config_SaveConfigFile
(
vlc_object_t
*
p_this
)
{
char
*
permanent
=
NULL
,
*
temporary
=
NULL
;
...
...
@@ -456,7 +444,7 @@ static int SaveConfigFile (vlc_object_t *p_this)
/* Configuration lock must be taken before vlcrc serializer below. */
vlc_rwlock_rdlock
(
&
config_lock
);
/* The temporary configuration file is per-PID. Therefore
SaveConfigFile()
/* The temporary configuration file is per-PID. Therefore
this function
* should be serialized against itself within a given process. */
static
vlc_mutex_t
lock
=
VLC_STATIC_MUTEX
;
vlc_mutex_lock
(
&
lock
);
...
...
@@ -643,15 +631,9 @@ int config_AutoSaveConfigFile( vlc_object_t *p_this )
if
(
save
)
/* Note: this will get the read lock recursively. Ok. */
ret
=
SaveConfigFile
(
p_this
);
ret
=
config_
SaveConfigFile
(
p_this
);
vlc_rwlock_unlock
(
&
config_lock
);
module_list_free
(
list
);
return
ret
;
}
#undef config_SaveConfigFile
int
config_SaveConfigFile
(
vlc_object_t
*
p_this
)
{
return
SaveConfigFile
(
p_this
);
}
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