y2mil("path1:" << dir1.fullname() << " path2:" << dir2.fullname());
struct stat stat1;
- int r1 = dir1.stat(".", &stat1, AT_SYMLINK_NOFOLLOW);
+ int r1 = dir1.stat(&stat1);
if (r1 != 0)
{
y2err("stat failed path:" << dir1.fullname() << " errno:" << errno);
}
struct stat stat2;
- int r2 = dir2.stat(".", &stat2, AT_SYMLINK_NOFOLLOW);
+ int r2 = dir2.stat(&stat2);
if (r2 != 0)
{
y2err("stat failed path:" << dir2.fullname() << " errno:" << errno);
}
+ int
+ SDir::stat(struct stat* buf) const
+ {
+ return ::fstat(dirfd, buf);
+ }
+
+
int
SDir::stat(const string& name, struct stat* buf, int flags) const
{
vector<string> entries() const;
vector<string> entries(std::function<bool(unsigned char type, const char* name)> pred) const;
+ int stat(struct stat* buf) const;
+
int stat(const string& name, struct stat* buf, int flags) const;
int open(const string& name, int flags) const;
int open(const string& name, int flags, mode_t mode) const;
SDir infos_dir(subvolume_dir, ".snapshots");
struct stat stat;
- if (infos_dir.stat(".", &stat, AT_SYMLINK_NOFOLLOW) != 0)
+ if (infos_dir.stat(&stat) != 0)
{
throw IOErrorException();
}
SDir infos_dir(subvolume_dir, ".snapshots");
struct stat stat;
- if (infos_dir.stat(".", &stat, AT_SYMLINK_NOFOLLOW) != 0)
+ if (infos_dir.stat(&stat) != 0)
{
throw IOErrorException();
}