mirror of
https://github.com/golang/go.git
synced 2025-05-29 11:25:43 +00: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:
parent
119917375b
commit
3fce00d99e
@ -136,11 +136,19 @@ func (w *Writer) Debug(m string) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (n netConn) writeBytes(p Priority, prefix string, b []byte) (int, 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) {
|
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 {
|
func (n netConn) close() error {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user