chiark / gitweb /
move _cleanup_ attribute in front of the type
[elogind.git] / src / shared / util.c
index 386973b3fcc75ce70620d65dcfb2dec951dd297e..1fc6c5aa1adf63476e1c7406b527b51f2896bd1f 100644 (file)
@@ -2080,7 +2080,7 @@ int release_terminal(void) {
                 .sa_handler = SIG_IGN,
                 .sa_flags = SA_RESTART,
         };
-        int _cleanup_close_ fd;
+        _cleanup_close_ int fd;
 
         fd = open("/dev/tty", O_RDWR|O_NOCTTY|O_NDELAY|O_CLOEXEC);
         if (fd < 0)
@@ -2779,8 +2779,9 @@ int rm_rf_children_dangerous(int fd, bool only_dirs, bool honour_sticky, struct
 
 static int is_temporary_fs(struct statfs *s) {
         assert(s);
-        return (unsigned __SWORD_TYPE) s->f_type == TMPFS_MAGIC ||
-                (unsigned __SWORD_TYPE) s->f_type == RAMFS_MAGIC;
+        return
+                F_TYPE_CMP(s->f_type, TMPFS_MAGIC) ||
+                F_TYPE_CMP(s->f_type, RAMFS_MAGIC);
 }
 
 int rm_rf_children(int fd, bool only_dirs, bool honour_sticky, struct stat *root_dev) {
@@ -4343,7 +4344,7 @@ int in_group(const char *name) {
 }
 
 int glob_exists(const char *path) {
-        glob_t _cleanup_globfree_ g = {};
+        _cleanup_globfree_ glob_t g = {};
         int r, k;
 
         assert(path);