editor: warn when write fails
Fixes warning: clients/editor.c: In function ‘data_source_send’: clients/editor.c:573:7: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] write(fd, editor->selected_text, strlen(editor->selected_text) + 1); ^
This commit is contained in:
parent
c056a987b6
commit
7dd12ec713
|
@ -570,7 +570,8 @@ data_source_send(void *data,
|
||||||
{
|
{
|
||||||
struct editor *editor = data;
|
struct editor *editor = data;
|
||||||
|
|
||||||
write(fd, editor->selected_text, strlen(editor->selected_text) + 1);
|
if (write(fd, editor->selected_text, strlen(editor->selected_text) + 1) < 0)
|
||||||
|
fprintf(stderr, "write failed: %m\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue