From ab80ad902e5914d8b7fbe08f155ac49917acbad0 Mon Sep 17 00:00:00 2001 From: Tudor Brindus Date: Sat, 10 Oct 2020 22:58:57 -0400 Subject: [PATCH] xwayland: using %m in `wlr_log` is broken, use `wlr_log_errno` instead This one was awful to track down, but calls to `wlr_log` with %m have the errno masked by the `isatty` call in `log_stderr`. Switch them to `wlr_log_errno` instead. Cue quality "how can read(2) POSSIBLY be returning ENOTTY?" moments. --- xwayland/selection/outgoing.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xwayland/selection/outgoing.c b/xwayland/selection/outgoing.c index 002c0143..33aa225b 100644 --- a/xwayland/selection/outgoing.c +++ b/xwayland/selection/outgoing.c @@ -92,7 +92,7 @@ static int xwm_data_source_read(int fd, uint32_t mask, void *data) { size_t available = transfer->source_data.alloc - current; ssize_t len = read(fd, p, available); if (len == -1) { - wlr_log(WLR_ERROR, "read error from data source: %m"); + wlr_log_errno(WLR_ERROR, "read error from data source"); goto error_out; } @@ -289,7 +289,7 @@ static void xwm_selection_send_data(struct wlr_xwm_selection *selection, int p[2]; if (pipe(p) == -1) { - wlr_log(WLR_ERROR, "pipe() failed: %m"); + wlr_log_errno(WLR_ERROR, "pipe() failed"); xwm_selection_send_notify(selection->xwm, req, false); return; }