From e235eac7e00a3f52299273f734723dbc9fbaee70 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sun, 24 Jun 2018 15:05:12 +0000 Subject: Add skagetln_loose, skagetlnsep_loose, ipc_timed_sendv --- src/libstddjb/skagetln_loose.c | 15 +++++++++++++++ src/libstddjb/skagetlnsep_loose.c | 15 +++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 src/libstddjb/skagetln_loose.c create mode 100644 src/libstddjb/skagetlnsep_loose.c (limited to 'src/libstddjb') diff --git a/src/libstddjb/skagetln_loose.c b/src/libstddjb/skagetln_loose.c new file mode 100644 index 0000000..7fc5916 --- /dev/null +++ b/src/libstddjb/skagetln_loose.c @@ -0,0 +1,15 @@ +/* ISC license. */ + +#include +#include +#include + +int skagetln_loose (buffer *b, stralloc *sa, char sep) +{ + int e = errno ; + int r = skagetln(b, sa, sep) ; + if (r >= 0) return r ; + if (errno != EPIPE) return -1 ; + if (!stralloc_0(sa)) return -1 ; + return (errno = e, 3) ; +} diff --git a/src/libstddjb/skagetlnsep_loose.c b/src/libstddjb/skagetlnsep_loose.c new file mode 100644 index 0000000..ad0fd0a --- /dev/null +++ b/src/libstddjb/skagetlnsep_loose.c @@ -0,0 +1,15 @@ +/* ISC license. */ + +#include +#include +#include + +int skagetlnsep_loose (buffer *b, stralloc *sa, char const *sep, size_t seplen) +{ + int e = errno ; + int r = skagetlnsep(b, sa, sep, seplen) ; + if (r >= 0) return r ; + if (errno != EPIPE) return -1 ; + if (!stralloc_0(sa)) return -1 ; + return (errno = e, 3) ; +} -- cgit v1.2.3