]> git.ozlabs.org Git - ccan/blobdiff - tools/grab_file.c
Moving grab_file
[ccan] / tools / grab_file.c
index 283a82b8c4cfff26a8038144f761195cd68b85df..5a2ff69b50ac1ab9a3304783ff03dc56e300cdc8 100644 (file)
@@ -1,22 +1,22 @@
 #include "tools.h"
 #include "talloc/talloc.h"
+#include "string/string.h"
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <errno.h>
-#include <string.h>
 
-static int close_no_errno(int fd)
+/*static int close_no_errno(int fd)
 {
        int ret = 0, serrno = errno;
        if (close(fd) < 0)
                ret = errno;
        errno = serrno;
        return ret;
-}
+}*/
 
-void *grab_fd(const void *ctx, int fd)
+/*void *grab_fd(const void *ctx, int fd)
 {
        int ret;
        unsigned int max = 16384, size = 0;
@@ -35,10 +35,10 @@ void *grab_fd(const void *ctx, int fd)
                buffer[size] = '\0';
 
        return buffer;
-}
+}*/
 
 /* This version adds one byte (for nul term) */
-void *grab_file(const void *ctx, const char *filename)
+/*void *grab_file(const void *ctx, const char *filename)
 {
        int fd;
        char *buffer;
@@ -54,5 +54,5 @@ void *grab_file(const void *ctx, const char *filename)
        buffer = grab_fd(ctx, fd);
        close_no_errno(fd);
        return buffer;
-}
+}*/