From 2905c9fcef1be428c60bc71543559d862ec558b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Thu, 21 May 2020 10:27:45 +0200 Subject: [PATCH] packagefs: for symlinks, return the symlink length as size. Change-Id: I60cc9c751a7426d18e27a9cbb163d43b80bcfa28 Reviewed-on: https://review.haiku-os.org/c/haiku/+/2761 Reviewed-by: Adrien Destugues Reviewed-by: waddlesplash --- .../file_systems/packagefs/nodes/UnpackingLeafNode.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/add-ons/kernel/file_systems/packagefs/nodes/UnpackingLeafNode.cpp b/src/add-ons/kernel/file_systems/packagefs/nodes/UnpackingLeafNode.cpp index cd8f76b6c3..5810d7cba4 100644 --- a/src/add-ons/kernel/file_systems/packagefs/nodes/UnpackingLeafNode.cpp +++ b/src/add-ons/kernel/file_systems/packagefs/nodes/UnpackingLeafNode.cpp @@ -91,8 +91,11 @@ UnpackingLeafNode::ModifiedTime() const off_t UnpackingLeafNode::FileSize() const { - if (PackageLeafNode* packageNode = _ActivePackageNode()) + if (PackageLeafNode* packageNode = _ActivePackageNode()) { + if (S_ISLNK(packageNode->Mode())) + return strlen(packageNode->SymlinkPath()); return packageNode->FileSize(); + } return 0; }