Commit 3fce00d9 authored by Rob Pike's avatar Rob Pike

log/syslog: return length of data provided by the user, not length of header

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5644059
parent 11991737
......@@ -136,11 +136,19 @@ func (w *Writer) Debug(m string) (err error) {
}
func (n netConn) writeBytes(p Priority, prefix string, b []byte) (int, error) {
return fmt.Fprintf(n.conn, "<%d>%s: %s\n", p, prefix, b)
_, err := fmt.Fprintf(n.conn, "<%d>%s: %s\n", p, prefix, b)
if err != nil {
return 0, err
}
return len(b), nil
}
func (n netConn) writeString(p Priority, prefix string, s string) (int, error) {
return fmt.Fprintf(n.conn, "<%d>%s: %s\n", p, prefix, s)
_, err := fmt.Fprintf(n.conn, "<%d>%s: %s\n", p, prefix, s)
if err != nil {
return 0, err
}
return len(s), nil
}
func (n netConn) close() error {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment