summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2019-05-18 11:14:53 -0700
committerKarolin Seeger <kseeger@samba.org>2019-06-13 10:22:07 +0000
commit54085531b9f74300dbadea212d89da412bc93c56 (patch)
treeca8415e3731165f53387c792ea91130ebad55ad7 /lib
parentcda1eaa2a79f93b7d262df85adb190e7fb0ea21f (diff)
downloadsamba-54085531b9f74300dbadea212d89da412bc93c56.tar.gz
lib: util: Remove file_pload()
No longer used. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13964 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit c5729ae44219ec81008040d4d50f0f5fdf254201)
Diffstat (limited to 'lib')
-rw-r--r--lib/util/samba_util.h1
-rw-r--r--lib/util/util_file.c46
2 files changed, 0 insertions, 47 deletions
diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h
index a4817f40ad9..48417a38e0f 100644
--- a/lib/util/samba_util.h
+++ b/lib/util/samba_util.h
@@ -397,7 +397,6 @@ bool file_compare(const char *path1, const char *path2);
/*
load from a pipe into memory.
*/
-char *file_pload(const char *syscmd, size_t *size);
char *file_ploadv(char * const argl[], size_t *size);
/* The following definitions come from lib/util/util.c */
diff --git a/lib/util/util_file.c b/lib/util/util_file.c
index af709dc52d0..102eac46131 100644
--- a/lib/util/util_file.c
+++ b/lib/util/util_file.c
@@ -365,52 +365,6 @@ bool file_compare(const char *path1, const char *path2)
return true;
}
-
-/**
- Load from a pipe into memory.
-**/
-char *file_pload(const char *syscmd, size_t *size)
-{
- int fd, n;
- char *p;
- char buf[1024];
- size_t total;
-
- fd = sys_popen(syscmd);
- if (fd == -1) {
- return NULL;
- }
-
- p = NULL;
- total = 0;
-
- while ((n = sys_read(fd, buf, sizeof(buf))) > 0) {
- p = talloc_realloc(NULL, p, char, total + n + 1);
- if (!p) {
- DEBUG(0,("file_pload: failed to expand buffer!\n"));
- close(fd);
- return NULL;
- }
- memcpy(p+total, buf, n);
- total += n;
- }
-
- if (p) {
- p[total] = 0;
- }
-
- /* FIXME: Perhaps ought to check that the command completed
- * successfully (returned 0); if not the data may be
- * truncated. */
- sys_pclose(fd);
-
- if (size) {
- *size = total;
- }
-
- return p;
-}
-
/**
Load from a pipe into memory.
**/