diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-10-09 07:16:49 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:59:40 -0500 |
commit | f9bac1dec23d2312d23d9605a39ce2819a10c1f3 (patch) | |
tree | 8b35f8d314a9056513522f1d1b55234819a23ca2 /source4/lib/util_file.c | |
parent | 7b7619e0ba489329ced5f5159f97ba7da5aa3fa5 (diff) | |
download | samba-f9bac1dec23d2312d23d9605a39ce2819a10c1f3.tar.gz samba-f9bac1dec23d2312d23d9605a39ce2819a10c1f3.tar.bz2 samba-f9bac1dec23d2312d23d9605a39ce2819a10c1f3.zip |
r2872: got rid of a couple of unused (and horrible) functions
(This used to be commit 4bb410756df13c8c23d21b43c1186f3f9cb9f758)
Diffstat (limited to 'source4/lib/util_file.c')
-rw-r--r-- | source4/lib/util_file.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/source4/lib/util_file.c b/source4/lib/util_file.c index 51e6c7187e..c4f794db0e 100644 --- a/source4/lib/util_file.c +++ b/source4/lib/util_file.c @@ -273,44 +273,6 @@ char *fgets_slash(char *s2,int maxlen,XFILE *f) } -/**************************************************************************** -load from a pipe into memory -****************************************************************************/ -char *file_pload(char *syscmd, size_t *size) -{ - int fd, n; - char *p, *tp; - pstring buf; - size_t total; - - fd = sys_popen(syscmd); - if (fd == -1) return NULL; - - p = NULL; - total = 0; - - while ((n = read(fd, buf, sizeof(buf))) > 0) { - tp = Realloc(p, total + n + 1); - if (!tp) { - DEBUG(0,("file_pload: failed to expand buffer!\n")); - close(fd); - SAFE_FREE(p); - return NULL; - } else p = tp; - 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 a file into memory from a fd. @@ -463,21 +425,6 @@ char **fd_lines_load(int fd, int *numlines) /**************************************************************************** -load a pipe into memory and return an array of pointers to lines in the data -must be freed with file_lines_free(). -****************************************************************************/ -char **file_lines_pload(char *syscmd, int *numlines) -{ - char *p; - size_t size; - - p = file_pload(syscmd, &size); - if (!p) return NULL; - - return file_lines_parse(p, size, numlines); -} - -/**************************************************************************** free lines loaded with file_lines_load ****************************************************************************/ void file_lines_free(char **lines) |