From 822ff99e6f6a5c8ad7309a535d384d354b2d326e Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Tue, 28 Mar 2023 02:34:37 +0200 Subject: [PATCH] posix.c: Make use of S_ISDIR --- posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posix.c b/posix.c index 4b8fde1..3d698aa 100644 --- a/posix.c +++ b/posix.c @@ -27,7 +27,7 @@ int mkdir_r_port(const char *const dir, const int flags) if (stat(dir, &sb)) return -1; - else if (!(sb.st_mode & S_IFDIR)) + else if (!S_ISDIR(sb.st_mode)) { errno = ENOTDIR; return -1;