summary refs log tree commit diff
path: root/nix/libstore/remote-store.cc
diff options
context:
space:
mode:
Diffstat (limited to 'nix/libstore/remote-store.cc')
-rw-r--r--nix/libstore/remote-store.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/nix/libstore/remote-store.cc b/nix/libstore/remote-store.cc
index 448d9b6bc1..9d75282334 100644
--- a/nix/libstore/remote-store.cc
+++ b/nix/libstore/remote-store.cc
@@ -109,7 +109,7 @@ void RemoteStore::connectToDaemon()
        applications... */
     AutoCloseFD fdPrevDir = open(".", O_RDONLY);
     if (fdPrevDir == -1) throw SysError("couldn't open current directory");
-    chdir(dirOf(socketPath).c_str());
+    if (chdir(dirOf(socketPath).c_str()) == -1) throw SysError("couldn't change current directory");
     Path socketPathRel = "./" + baseNameOf(socketPath);
 
     struct sockaddr_un addr;