mirror of
https://github.com/trapexit/mergerfs.git
synced 2025-04-01 16:15:11 +08:00
Merge pull request #1085 from trapexit/symlinkify
Fix setting of stat vars for symlinkify
This commit is contained in:
commit
8001c58c36
@ -139,7 +139,7 @@ namespace l
|
|||||||
return -errno;
|
return -errno;
|
||||||
|
|
||||||
if(symlinkify_ && symlinkify::can_be_symlink(*st_,symlinkify_timeout_))
|
if(symlinkify_ && symlinkify::can_be_symlink(*st_,symlinkify_timeout_))
|
||||||
st_->st_mode = symlinkify::convert(st_->st_mode);
|
symlinkify::convert(fullpath,st_);
|
||||||
|
|
||||||
fs::inode::calc(fusepath_,st_);
|
fs::inode::calc(fusepath_,st_);
|
||||||
|
|
||||||
|
@ -21,6 +21,9 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
namespace symlinkify
|
namespace symlinkify
|
||||||
{
|
{
|
||||||
static
|
static
|
||||||
@ -41,9 +44,12 @@ namespace symlinkify
|
|||||||
|
|
||||||
static
|
static
|
||||||
inline
|
inline
|
||||||
mode_t
|
void
|
||||||
convert(const mode_t mode_)
|
convert(const std::string &target_,
|
||||||
|
struct stat *st_)
|
||||||
{
|
{
|
||||||
return ((mode_ & ~S_IFMT) | S_IFLNK);
|
st_->st_mode = (((st_->st_mode & ~S_IFMT) | S_IFLNK) | 0777);
|
||||||
|
st_->st_size = target_.size();
|
||||||
|
st_->st_blocks = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user