mirror of
https://git.sr.ht/~cismonx/bookmarkfs
synced 2025-06-07 19:58:50 +00:00
chore: tidy up
This commit is contained in:
parent
f3f522ae63
commit
8cbd5846d9
5 changed files with 12 additions and 11 deletions
|
@ -1855,7 +1855,7 @@ backend_sandbox (
|
||||||
if (ctx->flags & BOOKMARKFS_BACKEND_READONLY) {
|
if (ctx->flags & BOOKMARKFS_BACKEND_READONLY) {
|
||||||
sandbox_flags |= SANDBOX_READONLY;
|
sandbox_flags |= SANDBOX_READONLY;
|
||||||
}
|
}
|
||||||
#ifdef __Linux__
|
#ifdef __linux__
|
||||||
if (ctx->flags & BOOKMARKFS_BACKEND_NO_LANDLOCK) {
|
if (ctx->flags & BOOKMARKFS_BACKEND_NO_LANDLOCK) {
|
||||||
sandbox_flags |= SANDBOX_NO_LANDLOCK;
|
sandbox_flags |= SANDBOX_NO_LANDLOCK;
|
||||||
}
|
}
|
||||||
|
@ -2465,7 +2465,8 @@ bookmark_rename (
|
||||||
debug_assert(!(ctx->flags & BOOKMARKFS_BACKEND_READONLY));
|
debug_assert(!(ctx->flags & BOOKMARKFS_BACKEND_READONLY));
|
||||||
|
|
||||||
if (old_parent_id == BOOKMARKS_ROOT_ID
|
if (old_parent_id == BOOKMARKS_ROOT_ID
|
||||||
|| new_parent_id == BOOKMARKS_ROOT_ID) {
|
|| new_parent_id == BOOKMARKS_ROOT_ID
|
||||||
|
) {
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
}
|
}
|
||||||
int status = store_load(ctx);
|
int status = store_load(ctx);
|
||||||
|
@ -2487,8 +2488,8 @@ bookmark_rename (
|
||||||
struct lookup_ctx old_lctx;
|
struct lookup_ctx old_lctx;
|
||||||
struct node_entry *old_entry;
|
struct node_entry *old_entry;
|
||||||
if (0 != lookup_name(ctx, old_parent_id, old_name, old_name_len,
|
if (0 != lookup_name(ctx, old_parent_id, old_name, old_name_len,
|
||||||
&old_lctx, &old_entry))
|
&old_lctx, &old_entry)
|
||||||
{
|
) {
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
json_t *old_node = old_entry->node;
|
json_t *old_node = old_entry->node;
|
||||||
|
@ -2509,8 +2510,8 @@ bookmark_rename (
|
||||||
struct lookup_ctx new_lctx;
|
struct lookup_ctx new_lctx;
|
||||||
struct node_entry *new_entry;
|
struct node_entry *new_entry;
|
||||||
if (0 == lookup_name(ctx, new_parent_id, new_name, new_name_len,
|
if (0 == lookup_name(ctx, new_parent_id, new_name, new_name_len,
|
||||||
&new_lctx, &new_entry))
|
&new_lctx, &new_entry)
|
||||||
{
|
) {
|
||||||
if (flags & BOOKMARKFS_BOOKMARK_RENAME_NOREPLACE) {
|
if (flags & BOOKMARKFS_BOOKMARK_RENAME_NOREPLACE) {
|
||||||
return -EEXIST;
|
return -EEXIST;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2127,8 +2127,8 @@ bookmark_do_list (
|
||||||
uint32_t bookmark_type = flags & BOOKMARKFS_BOOKMARK_TYPE_MASK;
|
uint32_t bookmark_type = flags & BOOKMARKFS_BOOKMARK_TYPE_MASK;
|
||||||
bookmark_type >>= BOOKMARKFS_BOOKMARK_TYPE_SHIFT;
|
bookmark_type >>= BOOKMARKFS_BOOKMARK_TYPE_SHIFT;
|
||||||
if (bookmark_type == BOOKMARKFS_BOOKMARK_TYPE_TAG
|
if (bookmark_type == BOOKMARKFS_BOOKMARK_TYPE_TAG
|
||||||
&& id == ctx->tags_root_id)
|
&& id == ctx->tags_root_id
|
||||||
{
|
) {
|
||||||
bookmark_type = BOOKMARKFS_BOOKMARK_TYPE_BOOKMARK;
|
bookmark_type = BOOKMARKFS_BOOKMARK_TYPE_BOOKMARK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,13 +30,13 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
# include <sys/xattr.h>
|
# include <sys/xattr.h>
|
||||||
#endif
|
#endif
|
||||||
#include <time.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "hash.h"
|
#include "hash.h"
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#define WATCHER_FALLBACK ( 1u << 0 )
|
#define WATCHER_FALLBACK ( 1u << 0 )
|
||||||
/**
|
/**
|
||||||
* Nothing is performed on the filesystem,
|
* Nothing is performed on the filesystem,
|
||||||
* and watcher_poll() always returns WATCHER_POLL_NOCHANGE.
|
* and watcher_poll() always returns -EAGAIN.
|
||||||
*/
|
*/
|
||||||
#define WATCHER_NOOP ( 1u << 1 )
|
#define WATCHER_NOOP ( 1u << 1 )
|
||||||
|
|
||||||
|
|
|
@ -171,7 +171,7 @@ xstrerror (
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Like xstrerror(), but takes `errno` as error number,
|
* Like xstrerror(), but takes `errno` as error number,
|
||||||
* and saves its value to `err_ptr`.
|
* and saves its value to `errnum_ptr`.
|
||||||
*/
|
*/
|
||||||
BOOKMARKFS_INTERNAL
|
BOOKMARKFS_INTERNAL
|
||||||
FUNCATTR_RETURNS_NONNULL
|
FUNCATTR_RETURNS_NONNULL
|
||||||
|
|
Loading…
Add table
Reference in a new issue