Skip to content

Commit

Permalink
Simplify FogmaFile to use in stream
Browse files Browse the repository at this point in the history
  • Loading branch information
linev committed May 24, 2024
1 parent 14dd833 commit 878bb30
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions plugins/dogma/src/DogmaFile.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
************************************************************/

#include "dogma/DogmaFile.h"
#include "dabc/logging.h"

bool dogma::DogmaFile::OpenWrite(const char* fname, const char* opt)
{
Expand Down Expand Up @@ -65,8 +64,6 @@ bool dogma::DogmaFile::OpenRead(const char* fname, const char* opt)

void dogma::DogmaFile::Close()
{
DOUT3("dogma::DogmaFile::Close()... ");

CloseBasicFile();

fEOF = true;
Expand All @@ -79,7 +76,7 @@ bool dogma::DogmaFile::WriteBuffer(void* buf, uint32_t bufsize)
if (!isWriting() || !buf || (bufsize == 0)) return false;

if (io->fwrite(buf, bufsize, 1, fd) != 1) {
EOUT("fail to write buffer payload of size %u", (unsigned) bufsize);
fprintf(stderr, "fail to write dogma buffer payload of size %u", (unsigned) bufsize);
CloseBasicFile();
return false;
}
Expand All @@ -95,8 +92,6 @@ bool dogma::DogmaFile::ReadBuffer(void* ptr, uint32_t* sz, bool onlyevent)

size_t readsz = io->fread(ptr, 1, (onlyevent ? sizeof(dogma::DogmaEvent) : maxsz), fd);

//printf("Read HLD portion of data %u max %u\n", (unsigned) readsz, (unsigned) maxsz);

if (readsz < sizeof(dogma::DogmaEvent)) {
if (!io->feof(fd)) fprintf(stderr, "Fail to read next portion but no EOF detected\n");
fEOF = true;
Expand Down

0 comments on commit 878bb30

Please sign in to comment.