pulse-server: use S_ISDIR()

Use the `S_ISDIR()` macro instead of `S_IFMT` and bitwise operations
to make the code simpler.
This commit is contained in:
Barnabás Pőcze 2021-07-25 01:57:44 +02:00
parent e90a70fd49
commit 2d27497045

View file

@ -94,7 +94,7 @@ int get_runtime_dir(char *buf, size_t buflen, const char *dir)
return res;
}
pw_log_info(NAME": created %s", buf);
} else if ((stat_buf.st_mode & S_IFMT) != S_IFDIR) {
} else if (!S_ISDIR(stat_buf.st_mode)) {
pw_log_error(NAME": %s is not a directory", buf);
return -ENOTDIR;
}