X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Ffs%2Funix%2Fstat.cpp;h=352363316f5bf47a1739451a44c92c78da257c2e;hp=1ba62cd1c3f8a752032c6f1a1baca95ce9a28051;hb=d91c3450a11c097d34ceba4444758fffe815b61a;hpb=497eaf090b1665511c795d5764c06a2bcd4b90b6 diff --git a/source/fs/unix/stat.cpp b/source/fs/unix/stat.cpp index 1ba62cd..3523633 100644 --- a/source/fs/unix/stat.cpp +++ b/source/fs/unix/stat.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "stat.h" #include "stat_private.h" @@ -47,10 +48,11 @@ Stat Stat::stat(const Path &path) int ret = ::stat(path.str().c_str(), &st); if(ret==-1) { - if(errno==ENOENT) + int err = errno; + if(err==ENOENT) return Stat(); else - throw system_error("stat"); + throw system_error(format("stat(%s)", path), err); } return Private::from_struct_stat(st); @@ -62,10 +64,11 @@ Stat Stat::lstat(const Path &path) int ret = ::lstat(path.str().c_str(), &st); if(ret==-1) { - if(errno==ENOENT) + int err = errno; + if(err==ENOENT) return Stat(); else - throw system_error("lstat"); + throw system_error(format("lstat(%s)", path), err); } return Private::from_struct_stat(st);