From: Jeremy Allison Date: Fri, 17 May 2019 05:10:51 +0000 (-0700) Subject: s3: lib: util: Add file_lines_ploadv(). X-Git-Tag: ldb-2.0.5~633 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3b19412baedfffb7adc2a79471f5b17990259c31;p=thirdparty%2Fsamba.git s3: lib: util: Add file_lines_ploadv(). Not yet used. Duplicate code to file_lines_pload() except uses vectored argument list. file_lines_pload() will be removed once all callers are converted. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13964 Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/lib/util_file.c b/source3/lib/util_file.c index cfbcf278caa..eeb749be36c 100644 --- a/source3/lib/util_file.c +++ b/source3/lib/util_file.c @@ -170,3 +170,18 @@ char **file_lines_pload(TALLOC_CTX *mem_ctx, const char *syscmd, return file_lines_parse(p, size, numlines, mem_ctx); } + +char **file_lines_ploadv(TALLOC_CTX *mem_ctx, + char * const argl[], + int *numlines) +{ + char *p = NULL; + size_t size; + + p = file_ploadv(argl, &size); + if (!p) { + return NULL; + } + + return file_lines_parse(p, size, numlines, mem_ctx); +} diff --git a/source3/lib/util_file.h b/source3/lib/util_file.h index 9175ed0dcee..85bcf06f38c 100644 --- a/source3/lib/util_file.h +++ b/source3/lib/util_file.h @@ -31,5 +31,8 @@ int file_pload_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, char **file_lines_pload(TALLOC_CTX *mem_ctx, const char *syscmd, int *numlines); +char **file_lines_ploadv(TALLOC_CTX *mem_ctx, + char * const argl[], + int *numlines); #endif