mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 10:41:26 +00:00
Truncate config file instead of deleting it before writing.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4728 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -1330,15 +1330,7 @@ sub serializeNkAttr {
|
||||
sub writeConfiguration {
|
||||
my $nonkey = shift;
|
||||
|
||||
if (-f $CONFIGFILE) {
|
||||
if (!unlink $CONFIGFILE) {
|
||||
print "Failed to save current configuration, specified ".
|
||||
"file exists and cannot be deleted.\n";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
my $io = new IO::File $CONFIGFILE, O_CREAT|O_WRONLY;
|
||||
my $io = new IO::File $CONFIGFILE, O_CREAT|O_WRONLY|O_TRUNC;
|
||||
|
||||
if (!$io) {
|
||||
print "Failed to save configuration to file '$CONFIGFILE': $!\n";
|
||||
|
||||
Reference in New Issue
Block a user