]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Move file_lines_ploadv() to lib/util/
authorVolker Lendecke <vl@samba.org>
Fri, 15 Aug 2025 08:04:55 +0000 (10:04 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 15 Aug 2025 10:53:31 +0000 (10:53 +0000)
Make it available to ctdb

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
lib/util/util_file.c
lib/util/util_file.h
source3/lib/sysquotas.c
source3/lib/util_file.c
source3/lib/util_file.h
source3/smbd/dfree.c

index 46e67f0a4a6d29e6d06cd280fa2ea36a9149d4bd..6c3efdfe2b77f5997f2a853a71d0e3f3d9ebe8bc 100644 (file)
@@ -491,6 +491,29 @@ char *file_ploadv(char * const argl[], size_t *size)
        return p;
 }
 
+/**
+ Load a pipe into memory and return an array of pointers to lines in the data
+ must be freed with TALLOC_FREE.
+**/
+
+char **file_lines_ploadv(TALLOC_CTX *mem_ctx,
+                        char *const argl[],
+                        int *numlines)
+{
+       char *p = NULL;
+       size_t size;
+       char **ret = NULL;
+
+       p = file_ploadv(argl, &size);
+       if (!p) {
+               return NULL;
+       }
+
+       ret = file_lines_parse(p, size, numlines, mem_ctx);
+       TALLOC_FREE(p);
+       return ret;
+}
+
 /*
  * fopen a dup'ed fd. Prevent fclose to close the fd passed in.
  *
index 8de75da5ed101153bb4796bab840a68450db9010..735a821b9a45be9946f563f2454c33d4ef300177 100644 (file)
@@ -77,6 +77,10 @@ bool file_compare(const char *path1, const char *path2);
  */
 char *file_ploadv(char * const argl[], size_t *size);
 
+char **file_lines_ploadv(TALLOC_CTX *mem_ctx,
+                        char *const argl[],
+                        int *numlines);
+
 FILE *fdopen_keepfd(int fd, const char *mode);
 
 #endif
index b7eedcd5c129102e0c48913f6216101effcb25f9..a984ec559c2a0ad5c73ae4cbc62e373acff3a4d3 100644 (file)
@@ -19,7 +19,7 @@
 
 
 #include "includes.h"
-#include "lib/util_file.h"
+#include "lib/util/util_file.h"
 #include "lib/util/smb_strtox.h"
 
 #undef DBGC_CLASS
index 21a6559fc439e709839f15a32de6db18e512ff9f..3baea15e2343c17d6e38fa3a5c979c3c19963e91 100644 (file)
@@ -165,27 +165,3 @@ int file_ploadv_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
 
        return 0;
 }
-
-
-/**
- Load a pipe into memory and return an array of pointers to lines in the data
- must be freed with TALLOC_FREE.
-**/
-
-char **file_lines_ploadv(TALLOC_CTX *mem_ctx,
-                       char * const argl[],
-                       int *numlines)
-{
-       char *p = NULL;
-       size_t size;
-       char **ret = NULL;
-
-       p = file_ploadv(argl, &size);
-       if (!p) {
-               return NULL;
-       }
-
-       ret = file_lines_parse(p, size, numlines, mem_ctx);
-       TALLOC_FREE(p);
-       return ret;
-}
index 1aef5a22b44345a2b4fe87c0c8e9c1e28d7b2a4c..abaee8c2a7cb051da870fc66009c9f4930f538ee 100644 (file)
@@ -28,8 +28,5 @@ struct tevent_req *file_ploadv_send(TALLOC_CTX *mem_ctx,
                                   char * const argl[], size_t maxsize);
 int file_ploadv_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
                    uint8_t **buf);
-char **file_lines_ploadv(TALLOC_CTX *mem_ctx,
-                       char * const argl[],
-                       int *numlines);
 
 #endif
index 89dc11293b52bc814cb4c56ab3a134b5f6b7bba9..919cf04286e36de6e1824432d721a8711ecde267 100644 (file)
@@ -20,7 +20,7 @@
 #include "includes.h"
 #include "smbd/smbd.h"
 #include "smbd/globals.h"
-#include "lib/util_file.h"
+#include "lib/util/util_file.h"
 #include "lib/util/memcache.h"
 
 /****************************************************************************