aboutsummaryrefslogtreecommitdiff
path: root/getl.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2017-07-19 11:29:27 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2017-07-19 11:29:27 +0300
commit651babfefa21536112cbcd799932b3595aeb2da4 (patch)
tree6922b7ea70642f4ce7a8cb97f01e62115e97d940 /getl.c
parent3e59cfb01443a14962547ed75bbbaaefa25a7633 (diff)
downloadruncap-651babfefa21536112cbcd799932b3595aeb2da4.tar.gz
runcap-651babfefa21536112cbcd799932b3595aeb2da4.tar.bz2
Rename struct filecapture to stream_capture; portability fixes
Diffstat (limited to 'getl.c')
-rw-r--r--getl.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/getl.c b/getl.c
index d989aa9..4bd352a 100644
--- a/getl.c
+++ b/getl.c
@@ -21,9 +21,8 @@
#include "runcap.h"
ssize_t
-runcap_getline(struct runcap *rc, int stream, char **pstr, size_t *psize)
+runcap_getline(struct runcap *rc, int sd, char **pstr, size_t *psize)
{
- struct filecapture *fp;
char *str;
size_t size;
size_t n;
@@ -38,10 +37,6 @@ runcap_getline(struct runcap *rc, int stream, char **pstr, size_t *psize)
str = *pstr;
size = *psize;
- fp = runcap_filecapture(rc, stream);
- if (!fp)
- return -1;
-
if (!str || size == 0) {
/* Initial allocation */
size = 16;
@@ -53,7 +48,7 @@ runcap_getline(struct runcap *rc, int stream, char **pstr, size_t *psize)
}
n = 0;
- while ((res = runcap_getc(rc, stream, &c)) == 1) {
+ while ((res = runcap_getc(rc, sd, &c)) == 1) {
if (n == size) {
char *p;
size_t sz;

Return to:

Send suggestions and report system problems to the System administrator.