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