diff --git a/src/libei-socket.c b/src/libei-socket.c index f4bcd4a..9884e8b 100644 --- a/src/libei-socket.c +++ b/src/libei-socket.c @@ -76,13 +76,17 @@ _public_ int ei_socket_init(struct ei *ei, const char *socketpath) { assert(ei); - assert(socketpath); - assert(socketpath[0] != '\0'); int rc = ei_init(ei); if (rc) return -rc; + if (!socketpath) + socketpath = getenv("LIBEI_SOCKET"); + + assert(socketpath); + assert(socketpath[0] != '\0'); + _cleanup_free_ char *path; if (socketpath[0] == '/') { path = xstrdup(socketpath);