From c1766dd7fee6ed067f4f2f28672af8e607b686ab Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Tue, 6 Apr 2004 18:20:19 +0000 Subject: [PATCH] Added debug info to Add_ToBeRep --- ChangeLog | 2 ++ mbfido/toberep.c | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 09e9f033..5debec87 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,8 @@ v0.51.3 22-Mar-2003 mbfido: The area tags are now created in /opt/mbse/share/doc/tags. + Added more debug info in Add_ToBeRep(), we still see double + announces of files like FP-DEF.ZIP. mblogin: Changed some defines for NetBSD 1.6.2 diff --git a/mbfido/toberep.c b/mbfido/toberep.c index 3f6930d7..df4b1ab2 100644 --- a/mbfido/toberep.c +++ b/mbfido/toberep.c @@ -66,7 +66,7 @@ int Add_ToBeRep(struct _filerecord report) * If it's a later received file, update the record */ if (report.Fdate > Temp.Fdate) { - Syslog('f', "Add_ToBeRep this file is newer, update record"); + Syslog('f', "Add_ToBeRep this file is newer, update record at position %d", ftell(tbr)); fseek(tbr, - sizeof(Temp), SEEK_SET); fwrite(&report, sizeof(report), 1, tbr); fclose(tbr); @@ -77,14 +77,14 @@ int Add_ToBeRep(struct _filerecord report) return TRUE; } } - if ((strcmp(Temp.Name, report.Name) == 0) && (Temp.Fdate == T_File.Fdate)) { + if ((strcmp(Temp.Name, report.Name) == 0) && (Temp.Fdate == report.Fdate)) { Syslog('f', "Add_ToBeRep record with same filename, but other area"); Found = TRUE; } } if (Found) { - Syslog('!', "File %s already in toberep.data", T_File.Name); + Syslog('!', "File %s already in toberep.data", report.Name); fclose(tbr); return FALSE; } @@ -92,8 +92,8 @@ int Add_ToBeRep(struct _filerecord report) /* * Append record */ - Syslog('f', "Add_ToBeRep append record"); - fwrite(&T_File, sizeof(T_File), 1, tbr); + Syslog('f', "Add_ToBeRep append record at position %ld", ftell(tbr)); + fwrite(&report, sizeof(report), 1, tbr); fclose(tbr); return TRUE; }