Skip to content

Commit

Permalink
return first error encountered
Browse files Browse the repository at this point in the history
  • Loading branch information
wkliao committed Mar 17, 2024
1 parent 1744c9d commit 0cd64d9
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/drivers/ncbbio/ncbbio_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,19 +391,18 @@ int ncbbio_log_close(NC_bb *ncbbp,
/* If log file is created, flush the log */
if (ncbbp->metalog_fd != NULL) {
/* Commit to CDF file */
if (replay && (headerp->num_entries > 0 || !(fIsSet(ncbbp->flag, NC_MODE_INDEP)))) {
ncbbio_log_flush_core(ncbbp);
if (replay && (headerp->num_entries > 0 ||
!(fIsSet(ncbbp->flag, NC_MODE_INDEP)))) {
status = ncbbio_log_flush_core(ncbbp);
}

/* Close log file */
/* Close metadata log file */
err = ncbbio_sharedfile_close(ncbbp->metalog_fd);
if (err != NC_NOERR) {
return err;
}
if (status == NC_NOERR) status = err;

/* Close data log file */
err = ncbbio_sharedfile_close(ncbbp->datalog_fd);
if (err != NC_NOERR) {
return err;
}
if (status == NC_NOERR) status = err;

/* Delete log files if delete flag is set */
if (ncbbp->hints & NC_LOG_HINT_DEL_ON_CLOSE) {
Expand Down

0 comments on commit 0cd64d9

Please sign in to comment.