From a7e08e893eb796637ca2c53cd32a529f453ace12 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 14 Nov 2016 22:40:40 -0500 Subject: Check for readdir() errors everywhere. --- util.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'util.h') diff --git a/util.h b/util.h index c3b3dbe..fbcadbd 100644 --- a/util.h +++ b/util.h @@ -12,8 +12,14 @@ #ifndef BFS_UTIL_H #define BFS_UTIL_H +#include #include +/** + * readdir() wrapper that makes error handling cleaner. + */ +int xreaddir(DIR *dir, struct dirent **de); + /** * Check if a file descriptor is open. */ -- cgit v1.2.3