summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorwmertens <Wout.Mertens@gmail.com>2014-10-06 08:00:11 +0200
committerwmertens <Wout.Mertens@gmail.com>2014-10-06 08:00:11 +0200
commit36641d9e69fddbd1e17f297a5fd0fa27332eab8c (patch)
tree0df9d0cf75f39963b8f996b4edb3525772c5658f /nixos
parentd3a7c503640437328d4069c22341d13ab02f152c (diff)
downloadnixlib-36641d9e69fddbd1e17f297a5fd0fa27332eab8c.tar
nixlib-36641d9e69fddbd1e17f297a5fd0fa27332eab8c.tar.gz
nixlib-36641d9e69fddbd1e17f297a5fd0fa27332eab8c.tar.bz2
nixlib-36641d9e69fddbd1e17f297a5fd0fa27332eab8c.tar.lz
nixlib-36641d9e69fddbd1e17f297a5fd0fa27332eab8c.tar.xz
nixlib-36641d9e69fddbd1e17f297a5fd0fa27332eab8c.tar.zst
nixlib-36641d9e69fddbd1e17f297a5fd0fa27332eab8c.zip
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`
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/system/etc/setup-etc.pl4
1 files 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;
 }