Skip to content

Commit 33ad232

Browse files
author
Yifan Gu
committed
sdjournal: Break the loop if error happens during Write().
1 parent 6dc8b84 commit 33ad232

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sdjournal/read.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ process:
161161
return ErrExpired
162162
default:
163163
if c > 0 {
164-
writer.Write(msg[:c])
164+
if err = writer.Write(msg[:c]); err != nil {
165+
break process
166+
}
165167
continue process
166168
}
167169
}

0 commit comments

Comments
 (0)