summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--posix.c2
1 files changed, 1 insertions, 1 deletions
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;