mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
selection: async send: handle POLLHUP
This commit is contained in:
parent
1207ad1502
commit
9cd22dc398
1 changed files with 4 additions and 1 deletions
|
|
@ -328,8 +328,10 @@ struct clipboard_send {
|
|||
static bool
|
||||
fdm_send(struct fdm *fdm, int fd, int events, void *data)
|
||||
{
|
||||
struct clipboard_send *ctx = data;
|
||||
if (events & EPOLLHUP)
|
||||
goto done;
|
||||
|
||||
struct clipboard_send *ctx = data;
|
||||
|
||||
switch (async_write(fd, ctx->data, ctx->len, &ctx->idx)) {
|
||||
case ASYNC_WRITE_REMAIN:
|
||||
|
|
@ -345,6 +347,7 @@ fdm_send(struct fdm *fdm, int fd, int events, void *data)
|
|||
break;
|
||||
}
|
||||
|
||||
done:
|
||||
fdm_del(fdm, fd);
|
||||
free(ctx->data);
|
||||
free(ctx);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue