]> git.tdb.fi Git - libs/core.git/blobdiff - source/fs/stat.cpp
Exception rework for fs components
[libs/core.git] / source / fs / stat.cpp
index 867256e6d8e2d404f6e32e298027730ead262a08..ccd344b875e809ecdbf3016e96d4576ab0c898dc 100644 (file)
@@ -1,8 +1,7 @@
-#include <cerrno>
 #ifdef WIN32
 #include <io.h>
 #endif
-#include <msp/core/except.h>
+#include <msp/core/systemerror.h>
 #include "path.h"
 #include "stat.h"
 
@@ -18,7 +17,7 @@ struct stat stat(const Path &fn)
 {
        struct stat st;
        if(stat(fn, st)==-1)
-               throw SystemError("stat failed", errno);
+               throw system_error("stat");
        return st;
 }
 
@@ -35,7 +34,7 @@ struct stat lstat(const Path &fn)
 {
        struct stat st;
        if(lstat(fn, st)==-1)
-               throw SystemError("lstat failed", errno);
+               throw system_error("lstat");
        return st;
 }