Skip to content

Commit

Permalink
Close the tempfile when journaling large messages
Browse files Browse the repository at this point in the history
When we fail to log a message to journald due to ENOBUFS or EMSGSIZE, we
attempt to pass the message to journald by passing it a descriptor
attached to some shared memory.  We need to close the descriptor, too.
  • Loading branch information
nalind committed Jan 27, 2016
1 parent 2ed5b50 commit ff118ad
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions journal/journal.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func Send(message string, priority Priority, vars map[string]string) error {
if err != nil {
return journalError(err.Error())
}
defer file.Close()
_, err = io.Copy(file, data)
if err != nil {
return journalError(err.Error())
Expand Down

0 comments on commit ff118ad

Please sign in to comment.