From 36641d9e69fddbd1e17f297a5fd0fa27332eab8c Mon Sep 17 00:00:00 2001 From: wmertens Date: Mon, 6 Oct 2014 08:00:11 +0200 Subject: [PATCH] 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` --- nixos/modules/system/etc/setup-etc.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/system/etc/setup-etc.pl b/nixos/modules/system/etc/setup-etc.pl index d7e15eccefcd..89a49b972ff9 100644 --- a/nixos/modules/system/etc/setup-etc.pl +++ b/nixos/modules/system/etc/setup-etc.pl @@ -12,8 +12,8 @@ sub atomicSymlink { my ($source, $target) = @_; my $tmp = "$target.tmp"; unlink $tmp; - symlink $source, $tmp or return 1; - rename $tmp, $target or return 1; + symlink $source, $tmp or return 0; + rename $tmp, $target or return 0; return 1; }