1
0
mirror of https://github.com/golang/go synced 2024-11-19 15:05:00 -07:00

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
This commit is contained in:
Rob Pike 2012-02-09 08:36:13 +11:00
parent 119917375b
commit 3fce00d99e

View File

@ -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 {