Skip to content

Commit

Permalink
update log_flush api to return # bytes flushed
Browse files Browse the repository at this point in the history
  • Loading branch information
kevyang committed Mar 1, 2016
1 parent ee6abc7 commit fe26565
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/cc_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ bool log_write(struct logger *logger, char *buf, uint32_t len);

void _log_fd(int fd, const char *fmt, ...);

void log_flush(struct logger *logger);
size_t log_flush(struct logger *logger);

#ifdef __cplusplus
}
Expand Down
4 changes: 3 additions & 1 deletion src/cc_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ _rbuf_flush(struct rbuf *buf, int fd)
return ret;
}

void
size_t
log_flush(struct logger *logger)
{
ssize_t n;
Expand All @@ -299,4 +299,6 @@ log_flush(struct logger *logger)
} else {
INCR(log_metrics, log_flush);
}

return n;
}

0 comments on commit fe26565

Please sign in to comment.