Check the return value of pipe
On some systems, pipe is declared with the attribute warn_unused_result, so we have to check the return value.
This commit is contained in:
parent
3ec74a0f2f
commit
69a7078e01
1 changed files with 4 additions and 1 deletions
5
main.c
5
main.c
|
@ -573,7 +573,10 @@ void keypress(struct menu_state *state, enum wl_keyboard_key_state key_state,
|
||||||
}
|
}
|
||||||
|
|
||||||
int fds[2];
|
int fds[2];
|
||||||
pipe(fds);
|
if (pipe(fds) == -1) {
|
||||||
|
// Pipe failed
|
||||||
|
return;
|
||||||
|
}
|
||||||
wl_data_offer_receive(state->offer, "text/plain", fds[1]);
|
wl_data_offer_receive(state->offer, "text/plain", fds[1]);
|
||||||
close(fds[1]);
|
close(fds[1]);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue