]> git.ozlabs.org Git - ccan/blobdiff - ccan/grab_file/grab_file.c
antithread, foreach, grab_file, hashtable, str_talloc: fix _info depends.
[ccan] / ccan / grab_file / grab_file.c
index b3a2f54d512ea07f5c10b9e95c5cafbb59bd0771..68a3b7cde32e483ba5cd8af768be15132a2ced13 100644 (file)
@@ -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;