mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-27 22:03:54 +03:00
setup-etc.pl: Fail when symlink/rename fails
When atomicSymlink can't symlink or rename, it should return failure. This is then handled with `... or die` and `... or warn`
This commit is contained in:
parent
d3a7c50364
commit
36641d9e69
@ -12,8 +12,8 @@ sub atomicSymlink {
|
|||||||
my ($source, $target) = @_;
|
my ($source, $target) = @_;
|
||||||
my $tmp = "$target.tmp";
|
my $tmp = "$target.tmp";
|
||||||
unlink $tmp;
|
unlink $tmp;
|
||||||
symlink $source, $tmp or return 1;
|
symlink $source, $tmp or return 0;
|
||||||
rename $tmp, $target or return 1;
|
rename $tmp, $target or return 0;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user