backend: ignore val_len when updating timestamps

This commit is contained in:
CismonX 2025-02-12 12:36:30 +08:00
parent a7575dc074
commit 3375674973
No known key found for this signature in database
GPG key ID: 3094873E29A482FB
3 changed files with 2 additions and 5 deletions

View file

@ -2614,7 +2614,6 @@ bookmark_set (
} }
if (flags & BOOKMARK_FLAG(SET_TIME)) { if (flags & BOOKMARK_FLAG(SET_TIME)) {
debug_assert(val_len == 2);
// Without UTIME_NOW, it is safe to cast away the const qualifier. // Without UTIME_NOW, it is safe to cast away the const qualifier.
struct timespec *times = (struct timespec *)val; struct timespec *times = (struct timespec *)val;
if (unlikely(0 != update_node_ts(entry->node, times))) { if (unlikely(0 != update_node_ts(entry->node, times))) {

View file

@ -3615,8 +3615,6 @@ bookmark_set (
int attr_type = ATTR_IN_MOZBM_START; int attr_type = ATTR_IN_MOZBM_START;
if (flags & BOOKMARK_FLAG(SET_TIME)) { if (flags & BOOKMARK_FLAG(SET_TIME)) {
debug_assert(val_len == 2);
struct timespec const *times = val; struct timespec const *times = val;
place_cols.last_visit_date = timespec_to_msecs(&times[0]); place_cols.last_visit_date = timespec_to_msecs(&times[0]);
bm_cols.last_modified = timespec_to_msecs(&times[1]); bm_cols.last_modified = timespec_to_msecs(&times[1]);

View file

@ -387,7 +387,7 @@ bm_do_write (
fh->mtime, fh->mtime,
}; };
uint32_t set_flags = BOOKMARK_FLAG(SET_TIME); uint32_t set_flags = BOOKMARK_FLAG(SET_TIME);
status = BACKEND_CALL(bookmark_set, id, NULL, set_flags, times, 2); status = BACKEND_CALL(bookmark_set, id, NULL, set_flags, times, 0);
if (status < 0) { if (status < 0) {
return status; return status;
} }
@ -1110,7 +1110,7 @@ bm_setattr (
if (is_tag) { if (is_tag) {
set_flags |= BOOKMARKFS_BOOKMARK_TYPE(TAG); set_flags |= BOOKMARKFS_BOOKMARK_TYPE(TAG);
} }
int status = BACKEND_CALL(bookmark_set, id, NULL, set_flags, times, 2); int status = BACKEND_CALL(bookmark_set, id, NULL, set_flags, times, 0);
if (status < 0) { if (status < 0) {
return status; return status;
} }