about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/references.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/libstore/references.cc b/src/libstore/references.cc
index 2bea44131ec0..2daf4d4f4d0a 100644
--- a/src/libstore/references.cc
+++ b/src/libstore/references.cc
@@ -59,12 +59,8 @@ void checkPath(const string & path,
         delete buf; /* !!! autodelete */
     }
     
-    else if (S_ISLNK(st.st_mode)) {
-        char buf[st.st_size];
-        if (readlink(path.c_str(), buf, st.st_size) != st.st_size)
-            throw SysError(format("reading symbolic link `%1%'") % path);
-        search(string(buf, st.st_size), ids, seen);
-    }
+    else if (S_ISLNK(st.st_mode))
+        search(readLink(path), ids, seen);
     
     else throw Error(format("unknown file type: %1%") % path);
 }