chiark / gitweb /
Allow braceless variables to be expanded
[elogind.git] / src / shared / clean-ipc.c
index 567dbbc991bda0680da850700998f6e409b1d028..3b4231827725cda1c912e59dcc20a314d17b333f 100644 (file)
@@ -36,7 +36,7 @@
 #include "dirent-util.h"
 #include "fd-util.h"
 #include "fileio.h"
-#include "formats-util.h"
+#include "format-util.h"
 #include "log.h"
 #include "macro.h"
 #include "string-util.h"
@@ -225,7 +225,7 @@ static int clean_posix_shm_internal(DIR *dir, uid_t uid, gid_t gid) {
         FOREACH_DIRENT_ALL(de, dir, goto fail) {
                 struct stat st;
 
-                if (STR_IN_SET(de->d_name, "..", "."))
+                if (dot_or_dot_dot(de->d_name))
                         continue;
 
                 if (fstatat(dirfd(dir), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0) {
@@ -311,7 +311,7 @@ static int clean_posix_mq(uid_t uid, gid_t gid) {
                 struct stat st;
                 char fn[1+strlen(de->d_name)+1];
 
-                if (STR_IN_SET(de->d_name, "..", "."))
+                if (dot_or_dot_dot(de->d_name))
                         continue;
 
                 if (fstatat(dirfd(dir), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0) {
@@ -388,6 +388,8 @@ int clean_ipc_by_uid(uid_t uid) {
         return clean_ipc(uid, GID_INVALID);
 }
 
+#if 0 /// UNNEEDED by elogind
 int clean_ipc_by_gid(gid_t gid) {
         return clean_ipc(UID_INVALID, gid);
 }
+#endif // 0