From bf663e40bbd5925730cc09058e589604a68deb38 Mon Sep 17 00:00:00 2001 From: bostic Date: Mon, 8 Nov 1993 11:08:30 +0000 Subject: [PATCH] revisit recovery code -- change so that keep a lock on the recovery mail file so that don't report live files as recoverable --- ex/ex_preserve.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ex/ex_preserve.c b/ex/ex_preserve.c index 71cffb75..27d0e9cd 100644 --- a/ex/ex_preserve.c +++ b/ex/ex_preserve.c @@ -6,10 +6,9 @@ */ #ifndef lint -static char sccsid[] = "$Id: ex_preserve.c,v 8.2 1993/08/05 18:07:44 bostic Exp $ (Berkeley) $Date: 1993/08/05 18:07:44 $"; +static char sccsid[] = "$Id: ex_preserve.c,v 8.3 1993/11/08 11:08:30 bostic Exp $ (Berkeley) $Date: 1993/11/08 11:08:30 $"; #endif /* not lint */ - #include #include @@ -36,13 +35,21 @@ ex_preserve(sp, ep, cmdp) return (1); } + /* If recovery not initialized, do so. */ + if (F_ISSET(ep, F_FIRSTMODIFY) && rcv_init(sp, ep)) + return (1); + /* Force the file to be read in, in case it hasn't yet. */ if (file_lline(sp, ep, &lno)) return (1); + /* Sync to disk. */ if (rcv_sync(sp, ep)) return (1); + + /* Preserve the recovery files. */ F_SET(ep, F_RCV_NORM); + msgq(sp, M_INFO, "File preserved."); return (0); } -- 2.11.4.GIT