coreos/etcd — pull request #204 by jespern (2013-10-05 17:52:08+00:00)
Title: fix: check whether net.Dial succeeds, otherwise we end up making a nil pointer

In bundled version of go-systemd, there is a bug in `func init()` on line 34, where a connection is instantiated, and the error is thrown away. This leads to the global `conn` being a nil pointer, and anything trying to use that at a later time will crash the program.

This pull requests addresses this by checking whether `net.Dial` fails, and if so, explicitly set `conn` to nil, so the rest of the code can appropriately handle that condition, as it is already coded to do.

Problem observed on Mac OSX 10.8.5, even after creating `/run/systemd/journal/` and having it be writable by the user.