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);
        ^
dev
Bryce Harrington 10 years ago
parent c056a987b6
commit 7dd12ec713
  1. 3
      clients/editor.c

@ -570,7 +570,8 @@ data_source_send(void *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

Loading…
Cancel
Save