fix readlink

This commit is contained in:
2023-07-15 00:43:02 +02:00
parent 929057ada1
commit 621f04db7a
2 changed files with 3 additions and 1 deletions

View File

@@ -31,7 +31,7 @@ jobs:
- name: Build - name: Build
# Build your program with the given configuration # Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel 4 run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel $(nproc)
- name: Test - name: Test
working-directory: ${{github.workspace}}/build working-directory: ${{github.workspace}}/build

View File

@@ -136,6 +136,8 @@ static int rfsReadlink(const char *path, char *buf, size_t size) {
if (entry->file->fileType != File::Type::Symlink) return -ENOENT; if (entry->file->fileType != File::Type::Symlink) return -ENOENT;
auto dst = Serialize::deserialize<Chunk>(RepoFS::repo->getObject(entry->file->chunks.at(0))); auto dst = Serialize::deserialize<Chunk>(RepoFS::repo->getObject(entry->file->chunks.at(0)));
strncpy(buf, dst.data.data(), std::min(dst.data.size(), size)); strncpy(buf, dst.data.data(), std::min(dst.data.size(), size));
return 0;
} }
static struct fuse_operations rfsOps = { static struct fuse_operations rfsOps = {