mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-02-20 19:50:36 +01:00
libei: take the LIBEI_SOCKET variable if the socket path is NULL
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
b1231dfa1f
commit
6062a0f676
1 changed files with 6 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue