From 35c40fc2facb96ebc49414cec0ab6df0a4782706 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Sat, 28 Dec 1996 13:50:34 +0000 Subject: [PATCH] Be a little less fatalistic in case of problems. Reviewed by: phk Submitted by: wosch --- usr.sbin/ctm/ctm/ctm_pass3.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr.sbin/ctm/ctm/ctm_pass3.c b/usr.sbin/ctm/ctm/ctm_pass3.c index 2b69c162b8d9..cf16a64bc3b1 100644 --- a/usr.sbin/ctm/ctm/ctm_pass3.c +++ b/usr.sbin/ctm/ctm/ctm_pass3.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: ctm_pass3.c,v 1.13 1996/04/29 21:02:32 phk Exp $ + * $Id: ctm_pass3.c,v 1.14 1996/08/30 10:20:58 phk Exp $ * */ @@ -227,12 +227,13 @@ Pass3(FILE *fd) sp->Key,name,i); WRONG } - rename(buf,name); - if(strcmp(md5,MD5File(name,md5_1))) { + if(strcmp(md5,MD5File(buf,md5_1))) { fprintf(stderr," %s %s Edit failed MD5 check.\n", sp->Key,name); WRONG } + if (rename(buf,name) == -1) + WRONG if (settime(name,times)) WRONG continue; }