From ed88bcfb7c15029f9fc95ee2380759a9eb782d46 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Wed, 16 Jul 2014 18:59:49 -0400 Subject: Be more careful when checking for empty files If we want to avoid reading a totally empty file, it seems better to check after we have opened the file, not before. --- src/shared/util.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/shared/util.h') diff --git a/src/shared/util.h b/src/shared/util.h index b3187a9ea1..d9d525e8a5 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -499,6 +499,7 @@ noreturn void freeze(void); bool null_or_empty(struct stat *st) _pure_; int null_or_empty_path(const char *fn); +int null_or_empty_fd(int fd); DIR *xopendirat(int dirfd, const char *name, int flags); -- cgit v1.2.3-54-g00ecf