From 1157bd7a839e12fc31a381e72528dcc4e9989365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=BAeen?= <3han5chou7@gmail.com> Date: Sun, 6 Jan 2019 00:57:46 +0900 Subject: [PATCH] do not use modern APIs --- src/stat_wrappers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stat_wrappers.c b/src/stat_wrappers.c index ffa0055..5b3f295 100644 --- a/src/stat_wrappers.c +++ b/src/stat_wrappers.c @@ -3,13 +3,13 @@ inline int idris_posix_stat_file_type(char *filename) { struct stat buffer; stat(filename, &buffer); - return buffer.st_mode & S_IFMT; + return buffer.st_mode; } inline int idris_posix_is_directory(char *filename) { - return idris_posix_stat_file_type(filename) == S_IFDIR; + return S_ISDIR(idris_posix_stat_file_type(filename)); } inline int idris_posix_is_file(char *filename) { - return idris_posix_stat_file_type(filename) == S_IFREG; + return S_ISREG(idris_posix_stat_file_type(filename)); }