mirror of
https://github.com/trapexit/mergerfs.git
synced 2025-02-22 08:29:56 +08:00
Merge pull request #278 from trapexit/ioctl-dir
fix ioctl on directories
This commit is contained in:
commit
68210d9252
@ -20,8 +20,10 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <linux/fs.h>
|
#include <sys/stat.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "config.hpp"
|
#include "config.hpp"
|
||||||
#include "fileinfo.hpp"
|
#include "fileinfo.hpp"
|
||||||
@ -48,10 +50,6 @@ _ioctl(const int fd,
|
|||||||
|
|
||||||
#ifdef FUSE_IOCTL_DIR
|
#ifdef FUSE_IOCTL_DIR
|
||||||
|
|
||||||
#ifndef O_DIRECTORY
|
|
||||||
#define O_DIRECTORY 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef O_NOATIME
|
#ifndef O_NOATIME
|
||||||
#define O_NOATIME 0
|
#define O_NOATIME 0
|
||||||
#endif
|
#endif
|
||||||
@ -76,7 +74,7 @@ _ioctl_dir_base(Policy::Func::Search searchFunc,
|
|||||||
|
|
||||||
fs::path::make(basepaths[0],fusepath,fullpath);
|
fs::path::make(basepaths[0],fusepath,fullpath);
|
||||||
|
|
||||||
const int flags = O_RDWR | O_NOATIME | O_DIRECTORY;
|
const int flags = O_RDONLY | O_NOATIME | O_NONBLOCK;
|
||||||
fd = ::open(fullpath.c_str(),flags);
|
fd = ::open(fullpath.c_str(),flags);
|
||||||
if(fd == -1)
|
if(fd == -1)
|
||||||
return -errno;
|
return -errno;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user