Skip to content

Commit e6d5b7f

Browse files
author
Casey Callendrello
authored
Merge pull request coreos#265 from muesli/journal-err-checks
journal: Added missing error handling for write & unlink calls
2 parents cb3f54f + eb353b6 commit e6d5b7f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

journal/journal.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ func Send(message string, priority Priority, vars map[string]string) error {
103103
if !ok {
104104
return journalError("can't send file through non-Unix connection")
105105
}
106-
unixConn.WriteMsgUnix([]byte{}, rights, nil)
106+
_, _, err = unixConn.WriteMsgUnix([]byte{}, rights, nil)
107+
if err != nil {
108+
return journalError(err.Error())
109+
}
107110
} else if err != nil {
108111
return journalError(err.Error())
109112
}
@@ -165,7 +168,7 @@ func tempFd() (*os.File, error) {
165168
if err != nil {
166169
return nil, err
167170
}
168-
syscall.Unlink(file.Name())
171+
err = syscall.Unlink(file.Name())
169172
if err != nil {
170173
return nil, err
171174
}

0 commit comments

Comments
 (0)