Skip to content

Commit

Permalink
Merge pull request #1 from jpvlsmv/master
Browse files Browse the repository at this point in the history
Set current_ to keep invariant in error case
  • Loading branch information
lmangani authored Mar 28, 2021
2 parents 355604b + 79e5c90 commit 84b9bb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stenotype/aio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Error Output::Rotate(const std::string& dirname, int64_t micros,
std::string name = HiddenFile(dirname, micros);
int fd = open(name.c_str(), O_CREAT | O_WRONLY | O_DSYNC | O_DIRECT, 0600);
LOG(INFO) << "Opening packet file " << name << ": " << fd;
RETURN_IF_ERROR(Errno(fd), "open");
RETURN_IF_ERROR(Errno(fd), (current_=NULL,"open") );
if (initial_size > 0) {
LOG_IF_ERROR(Errno(fallocate(fd, 0, 0, initial_size)), "fallocate");
}
Expand Down

0 comments on commit 84b9bb8

Please sign in to comment.