From 54299958430208905a97aff862ec0c51cd011d16 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 8 Sep 2009 20:29:37 +0930 Subject: [PATCH 1/1] Fix grab_file on other than regular files. --- ccan/grab_file/grab_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccan/grab_file/grab_file.c b/ccan/grab_file/grab_file.c index b3a2f54d..68a3b7cd 100644 --- a/ccan/grab_file/grab_file.c +++ b/ccan/grab_file/grab_file.c @@ -17,7 +17,7 @@ void *grab_fd(const void *ctx, int fd, size_t *size) size = &s; *size = 0; - if (fstat(fd, &st) == 0) + if (fstat(fd, &st) == 0 && S_ISREG(st.st_mode)) max = st.st_size; else max = 16384; -- 2.39.2