From 140c0e189880c4e7afb218b10536921a0a97fdf3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Mon, 2 Dec 2013 13:58:36 +0100 Subject: [PATCH] Properly truncate the file on re-create (using xattr with size instead of truncate()). --- src/VfsNs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VfsNs.cpp b/src/VfsNs.cpp index 6e5f8a2..fe05072 100644 --- a/src/VfsNs.cpp +++ b/src/VfsNs.cpp @@ -702,8 +702,8 @@ void VfsCatalog::create(const std::string& path, mode_t mode) throw (DmException for (it = file.begin(); it != file.end() && it->first.compare(0, VFS_XATTR_LENGTH + 8, VFS_XATTR "replica.") != 0; it++); if (it != file.end()) vfsThrow(EACCES, "can't truncate '%s' with replicas", path.c_str()); - // FIXME: setSize() - wrapCall(truncate(lpath.c_str(), 0)); + // setSize(path, 0) + vfsSetXattr(path, lpath, VFS_XATTR "size", "0", 0); } } -- 1.8.2.3