about summary refs log tree commit diff
path: root/src/nix-env/profiles.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-env/profiles.cc')
-rw-r--r--src/nix-env/profiles.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/nix-env/profiles.cc b/src/nix-env/profiles.cc
index c327993594e8..f7b306890d4c 100644
--- a/src/nix-env/profiles.cc
+++ b/src/nix-env/profiles.cc
@@ -118,8 +118,7 @@ void switchLink(Path link, Path target)
     if (dirOf(target) == dirOf(link)) target = baseNameOf(target);
 
     Path tmp = canonPath(dirOf(link) + "/.new_" + baseNameOf(link));
-    if (symlink(target.c_str(), tmp.c_str()) != 0)
-        throw SysError(format("creating symlink `%1%'") % tmp);
+    createSymlink(target, tmp);
     /* The rename() system call is supposed to be essentially atomic
        on Unix.  That is, if we have links `current -> X' and
        `new_current -> Y', and we rename new_current to current, a