blob: 58fc9301b040c4f4b5186dcfde8d144c53a0c4ff (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
/* ISC license. */
#include <skalibs/djbunix.h>
#include <skalibs/textmessage.h>
#include <skalibs/textclient.h>
void textclient_end (textclient_t *a)
{
fd_close(textmessage_sender_fd(&a->syncout)) ;
if (textmessage_receiver_fd(&a->syncin) != textmessage_sender_fd(&a->syncout))
fd_close(textmessage_receiver_fd(&a->syncin)) ;
fd_close(textmessage_receiver_fd(&a->asyncin)) ;
textmessage_sender_free(&a->syncout) ;
textmessage_receiver_free(&a->syncin) ;
textmessage_receiver_free(&a->asyncin) ;
if (a->pid && a->options & TEXTCLIENT_OPTION_WAITPID)
{
int wstat ;
waitpid_nointr(a->pid, &wstat, 0) ;
}
*a = textclient_zero ;
}
|