]> git.tdb.fi Git - libs/core.git/blobdiff - source/fs/utils.cpp
Add missing headers
[libs/core.git] / source / fs / utils.cpp
index e3c09fde6e79aa9c3d446d060a377ebeb8771ba8..a34dd4e54ca86d6baf72a877cea30d6daa959c91 100644 (file)
@@ -1,4 +1,7 @@
 #include <cstdio>
+#ifndef WIN32
+#include <unistd.h>
+#endif
 #include <msp/core/systemerror.h>
 #include <msp/strings/utils.h>
 #include "dir.h"
@@ -109,8 +112,7 @@ Path realpath(const Path &path)
                Path next = real/queue.front();
                queue.pop_front();
 
-               struct stat st = lstat(next);
-               if(S_ISLNK(st.st_mode))
+               if(is_link(next))
                {
                        if(++n_links>64)
                                throw runtime_error("too many symbolic links");