if (fd_ > 0) {
// TODO: should there be a flush here?
fprintf(stderr, "error, current file (%s) not closed\n", filename_.c_str());
- ::close(fd_);
+ if(-1 == ::close(fd_)) {
+ perror("TFileTransport: error in file close");
+ throw TTransportException("TFileTransport: error in file close");
+ }
}
if (fd) {
// close logfile
if (fd_ > 0) {
- ::close(fd_);
+ if(-1 == ::close(fd_)) {
+ perror("TFileTransport: error in file close");
+ }
}
}
if(closing_) {
if(-1 == ::close(fd_)) {
perror("TFileTransport: error in close");
+ throw TTransportException("TFileTransport: error in file close");
}
- throw TTransportException("error in file close");
fd_ = 0;
return;
}
if(outEvent->eventSize_ > 0) {
if(-1 == ::write(fd_, outEvent->eventBuff_, outEvent->eventSize_)) {
perror("TFileTransport: error while writing event");
- // TODO: should this trigger an exception or simply continue?
throw TTransportException("TFileTransport: error while writing event");
}
if (readState_.bufferLen_ == -1) {
readState_.resetAllValues();
perror("TFileTransport: error while reading from file");
- // TODO: should this trigger an exception or simply continue?
throw TTransportException("TFileTransport: error while reading from file");
} else if (readState_.bufferLen_ == 0) { // EOF
// wait indefinitely if there is no timeout
readState_.resetAllValues();
if (offset_ == -1) {
perror("TFileTransport: lseek error in seekToChunk");
- // TODO: should this trigger an exception or simply continue?
throw TTransportException("TFileTransport: lseek error in seekToChunk");
}