5 int readclose_append(int fd
,stralloc
*sa
,unsigned int bufsize
)
9 if (!stralloc_readyplus(sa
,bufsize
)) { close(fd
); return -1; }
10 r
= read(fd
,sa
->s
+ sa
->len
,bufsize
);
11 if (r
== -1) if (errno
== error_intr
) continue;
12 if (r
<= 0) { close(fd
); return r
; }
17 int readclose(int fd
,stralloc
*sa
,unsigned int bufsize
)
19 if (!stralloc_copys(sa
,"")) { close(fd
); return -1; }
20 return readclose_append(fd
,sa
,bufsize
);