Skip to content

Commit f147df1

Browse files
na-na-hiDudemanguy
authored andcommitted
wayland: print errno strerror for data offer read/write
1 parent 26cb87a commit f147df1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

player/clipboard/clipboard-wayland.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ static void data_source_handle_send(void *data,
203203
ssize_t data_written = write(fd, text.start, text.len);
204204
mp_mutex_unlock(&wl->lock);
205205
if (data_written == -1) {
206-
MP_VERBOSE(wl, "data source send aborted (write error)\n");
206+
MP_VERBOSE(wl, "data source send aborted (write error: %s)\n", mp_strerror(errno));
207207
} else {
208208
MP_VERBOSE(wl, "%zu bytes written to the data source fd\n", data_written);
209209
}
@@ -382,7 +382,7 @@ static void get_selection_data(struct clipboard_wayland_priv *wl, struct clipboa
382382
}
383383

384384
if (data_read == -1) {
385-
MP_VERBOSE(wl, "data offer aborted (read error)\n");
385+
MP_VERBOSE(wl, "data offer aborted (read error: %s)\n", mp_strerror(errno));
386386
} else {
387387
MP_VERBOSE(wl, "Read %zu bytes from the data offer fd\n", content.len);
388388
// Update clipboard text content

video/out/wayland_common.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ static void data_source_handle_send(void *data, struct wl_data_source *wl_data_s
922922
if (fdp.revents & POLLOUT) {
923923
ssize_t data_written = write(fd, wl->selection_text.start, wl->selection_text.len);
924924
if (data_written == -1) {
925-
MP_VERBOSE(wl, "data source send aborted (write error)\n");
925+
MP_VERBOSE(wl, "data source send aborted (write error: %s)\n", mp_strerror(errno));
926926
} else {
927927
MP_VERBOSE(wl, "%zu bytes written to the data source fd\n", data_written);
928928
}
@@ -2236,7 +2236,7 @@ static void check_fd(struct vo_wayland_state *wl, struct vo_wayland_data_offer *
22362236
}
22372237

22382238
if (data_read == -1) {
2239-
MP_VERBOSE(wl, "data offer aborted (read error)\n");
2239+
MP_VERBOSE(wl, "data offer aborted (read error: %s)\n", mp_strerror(errno));
22402240
} else {
22412241
MP_VERBOSE(wl, "Read %zu bytes from the data offer fd\n", content.len);
22422242

0 commit comments

Comments
 (0)