From b9c6a4693051d7bf331ccedefad59ceb59d8f0df Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 19 May 2000 06:18:52 +0000 Subject: [PATCH] Changed from Blocks as parameter to Bytes. --- hadaq/hwtape.c | 4 ++-- hadaq/hwtapelabel.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hadaq/hwtape.c b/hadaq/hwtape.c index be1df69..d75359f 100644 --- a/hadaq/hwtape.c +++ b/hadaq/hwtape.c @@ -97,7 +97,7 @@ static FILE *openTape(const char* filename) { setvbuf(outFile, 0, _IOFBF, BLOCKSIZE); } -int closeTape(FILE *openTape, int tape, int numBlocks, const char *filename) { +int closeTape(FILE *openTape, int tape, int numBytes, const char *filename) { int stat; stat = fclose(openTape); if (stat == -1) { @@ -105,7 +105,7 @@ int closeTape(FILE *openTape, int tape, int numBlocks, const char *filename) { exit(-2); } - writeTrailer(tape, 0, numBlocks, filename); + writeTrailer(tape, 0, numBytes, filename); stat = close(tape); if (stat == -1) { diff --git a/hadaq/hwtapelabel.c b/hadaq/hwtapelabel.c index 928a565..09b01d3 100644 --- a/hadaq/hwtapelabel.c +++ b/hadaq/hwtapelabel.c @@ -154,7 +154,7 @@ int writeHeader(int tape, int fileSeqNum, const char *filename) { } -int writeTrailer(int tape, int fileSeqNum, int numBlocks, const char *filename) { +int writeTrailer(int tape, int fileSeqNum, int numBytes, const char *filename) { int stat; int i; int blockSize = BLOCKSIZE; @@ -189,14 +189,14 @@ int writeTrailer(int tape, int fileSeqNum, int numBlocks, const char *filename) label = allocMem(80*sizeof(char)); - sprintf(label, "EOF1 %s0000010001%04d000100%s%02d%03d 99366 %06d%s ", ansichar(filename, 17), fileSeqNum, creaCent, (cd->tm_year)%100, cd->tm_yday, numBlocks, impId); + sprintf(label, "EOF1 %s0000010001%04d000100%s%02d%03d 99366 %06d%s ", ansichar(filename, 17), fileSeqNum, creaCent, (cd->tm_year)%100, cd->tm_yday, (numBytes + BLOCKSIZE - 1)/BLOCKSIZE, impId); stat = write(tape, label, 80); if(stat == -1) { msglog(LOG_ERR, "Could not write ANSI label on tape!\n"); exit(-3); } - sprintf(label, "EOF2F%05d%05d010664 bin %010d33000 ", blockSize, blockSize, numBlocks*blockSize); + sprintf(label, "EOF2F%05d%05d010664 bin %010d33000 ", blockSize, blockSize, numBytes); stat = write(tape, label, 80); if(stat == -1) { msglog(LOG_ERR, "Could not write ANSI label on tape!\n"); -- 2.43.0