New upstream version 2022.1

This commit is contained in:
Simon McVittie committed 2022-01-07 10:35:19 +00:00
commit 13edc15773
444 files changed
+968 -1498

No files matched your search

+1 -3
View File
@@ -13,9 +13,7 @@
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# License along with this library. If not, see <https://www.gnu.org/licenses/>.
bin_PROGRAMS += rofiles-fuse
+48 -5
View File
@@ -14,12 +14,14 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* License along with this library. If not, see <https://www.gnu.org/licenses/>.
*/
#define FUSE_USE_VERSION 26
#include "config.h"
#ifndef FUSE_USE_VERSION
#error config.h needs to define FUSE_USE_VERSION
#endif
#include <sys/types.h>
#include <sys/stat.h>
@@ -57,7 +59,11 @@ ENSURE_RELPATH (const char *path)
}
static int
#if FUSE_USE_VERSION >= 31
callback_getattr (const char *path, struct stat *st_data, struct fuse_file_info *finfo)
#else
callback_getattr (const char *path, struct stat *st_data)
#endif
{
path = ENSURE_RELPATH (path);
if (!*path)
@@ -91,8 +97,13 @@ callback_readlink (const char *path, char *buf, size_t size)
}
static int
#if FUSE_USE_VERSION >= 31
callback_readdir (const char *path, void *buf, fuse_fill_dir_t filler,
off_t offset, struct fuse_file_info *fi, enum fuse_readdir_flags flags)
#else
callback_readdir (const char *path, void *buf, fuse_fill_dir_t filler,
off_t offset, struct fuse_file_info *fi)
#endif
{
DIR *dp;
struct dirent *de;
@@ -125,8 +136,14 @@ callback_readdir (const char *path, void *buf, fuse_fill_dir_t filler,
memset (&st, 0, sizeof (st));
st.st_ino = de->d_ino;
st.st_mode = de->d_type << 12;
#if FUSE_USE_VERSION >= 31
if (filler (buf, de->d_name, &st, 0, 0))
break;
#else
if (filler (buf, de->d_name, &st, 0))
break;
#endif
}
(void) closedir (dp);
@@ -186,11 +203,21 @@ callback_symlink (const char *from, const char *to)
}
static int
#if FUSE_USE_VERSION >= 31
callback_rename (const char *from, const char *to, unsigned int flags)
#else
callback_rename (const char *from, const char *to)
#endif
{
#if FUSE_USE_VERSION < 31
unsigned int flags = 0;
#endif
from = ENSURE_RELPATH (from);
to = ENSURE_RELPATH (to);
if (renameat (basefd, from, basefd, to) == -1)
/* This assumes Linux 3.15+ */
if (renameat2 (basefd, from, basefd, to, flags) == -1)
return -errno;
return 0;
}
@@ -301,7 +328,11 @@ verify_write_or_copyup (const char *path, const struct stat *stbuf,
} while (0)
static int
#if FUSE_USE_VERSION >= 31
callback_chmod (const char *path, mode_t mode, struct fuse_file_info *finfo)
#else
callback_chmod (const char *path, mode_t mode)
#endif
{
PATH_WRITE_ENTRYPOINT (path);
@@ -315,7 +346,11 @@ callback_chmod (const char *path, mode_t mode)
}
static int
#if FUSE_USE_VERSION >= 31
callback_chown (const char *path, uid_t uid, gid_t gid, struct fuse_file_info *finfo)
#else
callback_chown (const char *path, uid_t uid, gid_t gid)
#endif
{
PATH_WRITE_ENTRYPOINT (path);
@@ -325,7 +360,11 @@ callback_chown (const char *path, uid_t uid, gid_t gid)
}
static int
#if FUSE_USE_VERSION >= 31
callback_truncate (const char *path, off_t size, struct fuse_file_info *finfo)
#else
callback_truncate (const char *path, off_t size)
#endif
{
PATH_WRITE_ENTRYPOINT (path);
@@ -340,7 +379,11 @@ callback_truncate (const char *path, off_t size)
}
static int
#if FUSE_USE_VERSION >= 31
callback_utimens (const char *path, const struct timespec tv[2], struct fuse_file_info *finfo)
#else
callback_utimens (const char *path, const struct timespec tv[2])
#endif
{
/* This one isn't write-verified, we support changing times
* even for hardlinked files.