From 2d27497045b10a629000c4d7170b1165ebd65e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Sun, 25 Jul 2021 01:57:44 +0200 Subject: [PATCH] pulse-server: use `S_ISDIR()` Use the `S_ISDIR()` macro instead of `S_IFMT` and bitwise operations to make the code simpler. --- src/modules/module-protocol-pulse/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/module-protocol-pulse/utils.c b/src/modules/module-protocol-pulse/utils.c index 27c7fd78e..844613a33 100644 --- a/src/modules/module-protocol-pulse/utils.c +++ b/src/modules/module-protocol-pulse/utils.c @@ -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; }