posix.c: Make use of S_ISDIR

This commit is contained in:
Xavier Del Campo Romero 2023-03-28 02:34:37 +02:00
parent ba58914cb1
commit 822ff99e6f
1 changed files with 1 additions and 1 deletions

View File

@ -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;