diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2023-07-21 06:55:57 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2023-07-21 06:55:57 +0000 |
| commit | 62c6c9a78a4ae33c1dc2fe5bdd029cd5c3325f0e (patch) | |
| tree | ad1d707570654f125578087ded7bbd475d1e1ee8 /client.c | |
| parent | meson: bump version to 1.15.0 (diff) | |
| parent | render: change baseline calculation, to center it within the line (diff) | |
Merge branch 'master' into releases/1.15
Diffstat (limited to 'client.c')
| -rw-r--r-- | client.c | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -374,16 +374,19 @@ main(int argc, char *const *argv) const char *xdg_runtime = getenv("XDG_RUNTIME_DIR"); if (xdg_runtime != NULL) { const char *wayland_display = getenv("WAYLAND_DISPLAY"); - if (wayland_display != NULL) + if (wayland_display != NULL) { snprintf(addr.sun_path, sizeof(addr.sun_path), "%s/foot-%s.sock", xdg_runtime, wayland_display); - else + connected = (connect(fd, (const struct sockaddr *)&addr, sizeof(addr)) == 0); + } + if (!connected) { + LOG_WARN("%s: failed to connect, will now try %s/foot.sock", + addr.sun_path, xdg_runtime); snprintf(addr.sun_path, sizeof(addr.sun_path), "%s/foot.sock", xdg_runtime); - - if (connect(fd, (const struct sockaddr *)&addr, sizeof(addr)) == 0) - connected = true; - else + connected = (connect(fd, (const struct sockaddr *)&addr, sizeof(addr)) == 0); + } + if (!connected) LOG_WARN("%s: failed to connect, will now try /tmp/foot.sock", addr.sun_path); } |
