Compare commits

...

2 commits

Author SHA1 Message Date
CismonX
328095ae43
build: install man pages by default
Since we're already installing man pages conditionally
(only install a man page when the corresponding program is enabled),
it makes more sense to install them by default,
instead of having to install separately with `make install-man`.
2025-07-09 21:02:22 +08:00
CismonX
d911439ca3
xattr: fix xattr_do_get/xattr_do_list return value
The functions should return negated errno on failure,
since bookmarkfs_xattr_get() and bookmarkfs_xattr_list() check
whether the syscall fails with ERANGE.
2025-07-06 11:29:55 +08:00
3 changed files with 6 additions and 3 deletions

View file

@ -147,7 +147,7 @@ Installation
Install the user manual: Install the user manual:
$ make install-man install-info $ make install-info
Uninstall: Uninstall:

View file

@ -13,8 +13,7 @@ AC_CONFIG_SRCDIR([src/bookmarkfs_util.pc.in])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_TESTDIR([tests]) AC_CONFIG_TESTDIR([tests])
AM_INIT_AUTOMAKE([1.14 foreign no-installinfo no-installman]) AM_INIT_AUTOMAKE([1.14 foreign no-installinfo])
AM_EXTRA_RECURSIVE_TARGETS([install-man])
AM_MISSING_PROG([AUTOM4TE], [autom4te]) AM_MISSING_PROG([AUTOM4TE], [autom4te])
PKG_PROG_PKG_CONFIG([0.27]) PKG_PROG_PKG_CONFIG([0.27])
LT_PREREQ([2.4.3]) LT_PREREQ([2.4.3])

View file

@ -63,11 +63,13 @@ xattr_do_get (
#if defined(__linux__) #if defined(__linux__)
result = fgetxattr(fd, name, buf, buf_len); result = fgetxattr(fd, name, buf, buf_len);
if (result < 0) { if (result < 0) {
result = -errno;
log_printf("fgetxattr(): %s", strerror(errno)); log_printf("fgetxattr(): %s", strerror(errno));
} }
#elif defined(__FreeBSD__) #elif defined(__FreeBSD__)
result = extattr_get_fd(fd, EXTATTR_NAMESPACE_USER, name, buf, buf_len); result = extattr_get_fd(fd, EXTATTR_NAMESPACE_USER, name, buf, buf_len);
if (result < 0) { if (result < 0) {
result = -errno;
log_printf("extattr_get_fd(): %s", strerror(errno)); log_printf("extattr_get_fd(): %s", strerror(errno));
} }
#else #else
@ -86,11 +88,13 @@ xattr_do_list (
#if defined(__linux__) #if defined(__linux__)
result = flistxattr(fd, buf, buf_len); result = flistxattr(fd, buf, buf_len);
if (result < 0) { if (result < 0) {
result = -errno;
log_printf("flistxattr(): %s", strerror(errno)); log_printf("flistxattr(): %s", strerror(errno));
} }
#elif defined(__FreeBSD__) #elif defined(__FreeBSD__)
result = extattr_list_fd(fd, EXTATTR_NAMESPACE_USER, buf, buf_len); result = extattr_list_fd(fd, EXTATTR_NAMESPACE_USER, buf, buf_len);
if (result < 0) { if (result < 0) {
result = -errno;
log_printf("extattr_list_fd(): %s", strerror(errno)); log_printf("extattr_list_fd(): %s", strerror(errno));
} }
#else #else