diff --git a/doc/bookmarkfs.texi b/doc/bookmarkfs.texi index 7176c95..bba3030 100644 --- a/doc/bookmarkfs.texi +++ b/doc/bookmarkfs.texi @@ -1486,7 +1486,6 @@ The first element of the list is an integer indicating the reason for this handler call: @table @code -@item $::bookmarkfs::fsck::result::end @item $::bookmarkfs::fsck::result::nameDuplicate @item $::bookmarkfs::fsck::result::nameBadChar @item $::bookmarkfs::fsck::result::nameBadLen @@ -1494,8 +1493,7 @@ this handler call: @item $::bookmarkfs::fsck::result::nameInvalid @xref{Filesystem-check Result Code} for the meaning of each value. -Except for @code{$::bookmarkfs::fsck::result::end}, the second element -is a list of information about the current entry: +The second element is a list of information about the current entry: @enumerate 0 @item The bookmark ID @@ -1569,7 +1567,7 @@ coroutine whatever apply @{@{@} @{ set args [yield [info coroutine]] while 1 @{ lassign $args why data - if @{$why > $::bookmarkfs::fsck::result::end@} @{ + if @{$why > -1@} @{ lassign $data id extra name parent puts "id: $id, extra: $extra, name: $name, parent: $parent" @} diff --git a/src/fsck.c b/src/fsck.c index afa3237..147ab8c 100644 --- a/src/fsck.c +++ b/src/fsck.c @@ -165,6 +165,9 @@ do_fsck ( if (result < 0) { return -1; } + if (result == BOOKMARKFS_FSCK_RESULT_END) { + result = -1; + } goto run_handler; } #ifdef BOOKMARKFS_INTERACTIVE_FSCK diff --git a/src/fsck_handler_simple.c b/src/fsck_handler_simple.c index 2513d1f..e754451 100644 --- a/src/fsck_handler_simple.c +++ b/src/fsck_handler_simple.c @@ -279,10 +279,8 @@ handle_entry ( int control = BOOKMARKFS_FSCK_NEXT; if (!(ctx->flags & BOOKMARKFS_BACKEND_READONLY)) { - if (why != BOOKMARKFS_FSCK_RESULT_END) { - fix_entry(ctx, why, entry_data); - control = BOOKMARKFS_FSCK_APPLY; - } + fix_entry(ctx, why, entry_data); + control = BOOKMARKFS_FSCK_APPLY; } #ifdef BOOKMARKFS_INTERACTIVE_FSCK if (ctx->flags & BOOKMARKFS_FSCK_HANDLER_INTERACTIVE) { diff --git a/src/fsck_handler_tcl.c b/src/fsck_handler_tcl.c index 6e23de6..8266945 100644 --- a/src/fsck_handler_tcl.c +++ b/src/fsck_handler_tcl.c @@ -159,7 +159,6 @@ init_interp ( DO_SET_VAR(interp, "handler::reset", BOOKMARKFS_FSCK_RESET); #define DO_SET_RESULT_VAR(interp, name, val) \ DO_SET_VAR(interp, "result::" name, BOOKMARKFS_FSCK_RESULT_##val) - DO_SET_RESULT_VAR(interp, "end", END); DO_SET_RESULT_VAR(interp, "nameDuplicate", NAME_DUPLICATE); DO_SET_RESULT_VAR(interp, "nameBadChar", NAME_BADCHAR); DO_SET_RESULT_VAR(interp, "nameBadLen", NAME_BADLEN); @@ -365,6 +364,10 @@ fsck_handler_run ( break; case BOOKMARKFS_FSCK_APPLY: + if (ctx->flags & BOOKMARKFS_BACKEND_READONLY) { + log_puts("cannot apply, fsck is running in readonly mode"); + return -1; + } if (TCL_OK != Tcl_ListObjIndex(interp, result_obj, 1, &data_obj)) { log_puts("bad return value, no new name given"); return -1;