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
75dda08f
Commit
75dda08f
authored
Jul 12, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config: Remove temporary file if replacement failed
parent
644185a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
src/config/file.c
src/config/file.c
+4
-2
No files found.
src/config/file.c
View file @
75dda08f
...
...
@@ -680,7 +680,8 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
#ifndef WIN32
fdatasync
(
fd
);
/* Flush from OS */
/* Atomically replace the file... */
utf8_rename
(
temporary
,
permanent
);
if
(
utf8_rename
(
temporary
,
permanent
))
utf8_unlink
(
temporary
);
/* (...then synchronize the directory, err, TODO...) */
/* ...and finally close the file */
vlc_mutex_unlock
(
&
lock
);
...
...
@@ -689,7 +690,8 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
#ifdef WIN32
/* Windows cannot remove open files nor overwrite existing ones */
utf8_unlink
(
permanent
);
utf8_rename
(
temporary
,
permanent
);
if
(
utf8_rename
(
temporary
,
permanent
))
utf8_unlink
(
temporary
);
vlc_mutex_unlock
(
&
lock
);
#endif
...
...
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