~kennylevinsen/seatd-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] libseat: log error when failing to open socket

Details
Message ID
<20201121155901.29951-1-ifreund@ifreund.xyz>
DKIM signature
pass
Download raw message
Patch: +1 -1
The most common pain point I've seen with people trying out seat is
forgetting to add themselves to whatever group the distro has chosen
to own the socket.

Logging this error and path of the socket should make it easier to tell
why things aren't working.
---
 libseat/backend/seatd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libseat/backend/seatd.c b/libseat/backend/seatd.c
index f728a33..e4ce7c4 100644
--- a/libseat/backend/seatd.c
+++ b/libseat/backend/seatd.c
@@ -75,7 +75,7 @@ static int seatd_connect(void) {
	strncpy(addr.unix.sun_path, path, sizeof addr.unix.sun_path - 1);
	socklen_t size = offsetof(struct sockaddr_un, sun_path) + strlen(addr.unix.sun_path);
	if (connect(fd, &addr.generic, size) == -1) {
		log_debugf("Could not connect to socket: %s", strerror(errno));
		log_errorf("Could not connect to socket %s: %s", path, strerror(errno));
		close(fd);
		return -1;
	};
-- 
2.29.2
Details
Message ID
<DD06KQ.6YWD7MA0VXZO3@kl.wtf>
In-Reply-To
<20201121155901.29951-1-ifreund@ifreund.xyz> (view parent)
DKIM signature
pass
Download raw message
On Sat, Nov 21, 2020 at 16:59, Isaac Freund <ifreund@ifreund.xyz> wrote:
> The most common pain point I've seen with people trying out seat is
> forgetting to add themselves to whatever group the distro has chosen
> to own the socket.
> 
> Logging this error and path of the socket should make it easier to 
> tell
> why things aren't working.
> ---
>  libseat/backend/seatd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libseat/backend/seatd.c b/libseat/backend/seatd.c
> index f728a33..e4ce7c4 100644
> --- a/libseat/backend/seatd.c
> +++ b/libseat/backend/seatd.c
> @@ -75,7 +75,7 @@ static int seatd_connect(void) {
>  	strncpy(addr.unix.sun_path, path, sizeof addr.unix.sun_path - 1);
>  	socklen_t size = offsetof(struct sockaddr_un, sun_path) + 
> strlen(addr.unix.sun_path);
>  	if (connect(fd, &addr.generic, size) == -1) {
> -		log_debugf("Could not connect to socket: %s", strerror(errno));
> +		log_errorf("Could not connect to socket %s: %s", path, 
> strerror(errno));
>  		close(fd);
>  		return -1;
>  	};
> --
> 2.29.2

Applied, thanks!
Reply to thread Export thread (mbox)