OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [go/] [log/] [syslog/] [syslog_unix.go] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 747 jeremybenn
// Copyright 2009 The Go Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
4
 
5
package syslog
6
 
7
import (
8
        "errors"
9
        "net"
10
)
11
 
12
// unixSyslog opens a connection to the syslog daemon running on the
13
// local machine using a Unix domain socket.
14
 
15
func unixSyslog() (conn serverConn, err error) {
16
        logTypes := []string{"unixgram", "unix"}
17
        logPaths := []string{"/dev/log", "/var/run/syslog"}
18
        var raddr string
19
        for _, network := range logTypes {
20
                for _, path := range logPaths {
21
                        raddr = path
22
                        conn, err := net.Dial(network, raddr)
23
                        if err != nil {
24
                                continue
25
                        } else {
26
                                return netConn{conn}, nil
27
                        }
28
                }
29
        }
30
        return nil, errors.New("Unix syslog delivery error")
31
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.