]> Cypherpunks repositories - gostls13.git/commitdiff
log/syslog: report errors from Fprintf
authorRob Pike <r@golang.org>
Wed, 22 May 2013 18:03:10 +0000 (11:03 -0700)
committerRob Pike <r@golang.org>
Wed, 22 May 2013 18:03:10 +0000 (11:03 -0700)
Thanks to chiparus for identifying this.

Fixes #5541.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/9658043

src/pkg/log/syslog/syslog.go

index 8bdd9825e1cdb045800047c12a9cc5df1d4e2d65..3d7ab6febd7d2e53121934b22a6c2e498865f46a 100644 (file)
@@ -258,10 +258,9 @@ func (w *Writer) write(p Priority, msg string) (int, error) {
        }
 
        timestamp := time.Now().Format(time.RFC3339)
-       fmt.Fprintf(w.conn, "<%d>%s %s %s[%d]: %s%s",
+       return fmt.Fprintf(w.conn, "<%d>%s %s %s[%d]: %s%s",
                p, timestamp, w.hostname,
                w.tag, os.Getpid(), msg, nl)
-       return len(msg), nil
 }
 
 // NewLogger creates a log.Logger whose output is written to