lib/nfs/Connection: use nfs_stat64_async
Since nfs_stat_async is deprecated.
This commit is contained in:
parent
f2caac595a
commit
9127afbf3f
@ -47,9 +47,9 @@ NfsConnection::CancellableCallback::Stat(nfs_context *ctx,
|
|||||||
{
|
{
|
||||||
assert(connection.GetEventLoop().IsInside());
|
assert(connection.GetEventLoop().IsInside());
|
||||||
|
|
||||||
int result = nfs_stat_async(ctx, path, Callback, this);
|
int result = nfs_stat64_async(ctx, path, Callback, this);
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
throw FormatRuntimeError("nfs_stat_async() failed: %s",
|
throw FormatRuntimeError("nfs_stat64_async() failed: %s",
|
||||||
nfs_get_error(ctx));
|
nfs_get_error(ctx));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,19 +246,19 @@ NfsStorage::MapToRelativeUTF8(const char *uri_utf8) const noexcept
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
Copy(StorageFileInfo &info, const struct stat &st)
|
Copy(StorageFileInfo &info, const struct nfs_stat_64 &st)
|
||||||
{
|
{
|
||||||
if (S_ISREG(st.st_mode))
|
if (S_ISREG(st.nfs_mode))
|
||||||
info.type = StorageFileInfo::Type::REGULAR;
|
info.type = StorageFileInfo::Type::REGULAR;
|
||||||
else if (S_ISDIR(st.st_mode))
|
else if (S_ISDIR(st.nfs_mode))
|
||||||
info.type = StorageFileInfo::Type::DIRECTORY;
|
info.type = StorageFileInfo::Type::DIRECTORY;
|
||||||
else
|
else
|
||||||
info.type = StorageFileInfo::Type::OTHER;
|
info.type = StorageFileInfo::Type::OTHER;
|
||||||
|
|
||||||
info.size = st.st_size;
|
info.size = st.nfs_size;
|
||||||
info.mtime = st.st_mtime;
|
info.mtime = st.nfs_mtime;
|
||||||
info.device = st.st_dev;
|
info.device = st.nfs_dev;
|
||||||
info.inode = st.st_ino;
|
info.inode = st.nfs_ino;
|
||||||
}
|
}
|
||||||
|
|
||||||
class NfsGetInfoOperation final : public BlockingNfsOperation {
|
class NfsGetInfoOperation final : public BlockingNfsOperation {
|
||||||
@ -279,7 +279,7 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void HandleResult(gcc_unused unsigned status, void *data) override {
|
void HandleResult(gcc_unused unsigned status, void *data) override {
|
||||||
Copy(info, *(const struct stat *)data);
|
Copy(info, *(const struct nfs_stat_64 *)data);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user