chiark / gitweb /
Rename F_TYPE_CMP() to F_TYPE_EQUAL()
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 16 Aug 2013 03:13:48 +0000 (23:13 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 21 Aug 2013 01:18:43 +0000 (21:18 -0400)
TODO
src/gpt-auto-generator/gpt-auto-generator.c
src/journal/sd-journal.c
src/readahead/readahead-collect.c
src/shared/macro.h
src/shared/util.c

diff --git a/TODO b/TODO
index 5c5e4b46f9d6306f6d9976e3b46043d86f25e9f3..9bc14fdbf531aef2b30f8b17ee8be80aeddfb50b 100644 (file)
--- a/TODO
+++ b/TODO
@@ -57,8 +57,6 @@ Features:
 
 * better error message if you run systemctl without systemd running
 
-* rename F_TYPE_CMP() to F_TYPE_EQUAL()
-
 * unlink PID files of units after exit
 
 * tiny tool that saves/restores backlight
index 5c0e455338f4c4b1a42cc2b07c1553612bfef09b..880661e277101064ced6246364a6b51b762ea29f 100644 (file)
@@ -434,7 +434,7 @@ static int get_block_device(const char *path, dev_t *dev) {
         if (statfs("/", &sfs) < 0)
                 return -errno;
 
-        if (F_TYPE_CMP(sfs.f_type, BTRFS_SUPER_MAGIC))
+        if (F_TYPE_EQUAL(sfs.f_type, BTRFS_SUPER_MAGIC))
                 return get_btrfs_block_device(path, dev);
 
         return 0;
index a83c0c25bfed032cc4bb1b5e7c7f75a81f1fadd5..7700d6cb128a1cc7de0d2d52a9ec5f9667b65256 100644 (file)
@@ -1266,11 +1266,11 @@ static void check_network(sd_journal *j, int fd) {
                 return;
 
         j->on_network =
-                F_TYPE_CMP(sfs.f_type, CIFS_MAGIC_NUMBER) ||
-                F_TYPE_CMP(sfs.f_type, CODA_SUPER_MAGIC) ||
-                F_TYPE_CMP(sfs.f_type, NCP_SUPER_MAGIC) ||
-                F_TYPE_CMP(sfs.f_type, NFS_SUPER_MAGIC) ||
-                F_TYPE_CMP(sfs.f_type, SMB_SUPER_MAGIC);
+                F_TYPE_EQUAL(sfs.f_type, CIFS_MAGIC_NUMBER) ||
+                F_TYPE_EQUAL(sfs.f_type, CODA_SUPER_MAGIC) ||
+                F_TYPE_EQUAL(sfs.f_type, NCP_SUPER_MAGIC) ||
+                F_TYPE_EQUAL(sfs.f_type, NFS_SUPER_MAGIC) ||
+                F_TYPE_EQUAL(sfs.f_type, SMB_SUPER_MAGIC);
 }
 
 static bool file_has_type_prefix(const char *prefix, const char *filename) {
index 5d37bb75f3c3da7b11f507906afd892d3d6899ad..32888add01be1a84cc3b178689ab141426e6e809 100644 (file)
@@ -510,7 +510,7 @@ done:
         on_ssd = fs_on_ssd(root) > 0;
         log_debug("On SSD: %s", yes_no(on_ssd));
 
-        on_btrfs = statfs(root, &sfs) >= 0 && F_TYPE_CMP(sfs.f_type, BTRFS_SUPER_MAGIC);
+        on_btrfs = statfs(root, &sfs) >= 0 && F_TYPE_EQUAL(sfs.f_type, BTRFS_SUPER_MAGIC);
         log_debug("On btrfs: %s", yes_no(on_btrfs));
 
         if (asprintf(&pack_fn_new, "%s/.readahead.new", root) < 0) {
index 969329d152368127cd38e133dc4db6b50ae4334d..0d3ff1cda578808ec2cb225ee4d97ce5ba213099 100644 (file)
@@ -273,7 +273,7 @@ do {                                                                    \
   * the const magic to the type, otherwise the compiler warns about
   * signed/unsigned comparison, because the magic can be 32 bit unsigned.
  */
-#define F_TYPE_CMP(a, b) (a == (typeof(a)) b)
+#define F_TYPE_EQUAL(a, b) (a == (typeof(a)) b)
 
 
 /* Returns the number of chars needed to format variables of the
index f23dd92a6b97ecdde00b2509c77ea9d517c8a732..ca9c2eb9d138486b0f6608226fd8d3137e5e8ba7 100644 (file)
@@ -2830,8 +2830,8 @@ int rm_rf_children_dangerous(int fd, bool only_dirs, bool honour_sticky, struct
 _pure_ static int is_temporary_fs(struct statfs *s) {
         assert(s);
         return
-                F_TYPE_CMP(s->f_type, TMPFS_MAGIC) ||
-                F_TYPE_CMP(s->f_type, RAMFS_MAGIC);
+                F_TYPE_EQUAL(s->f_type, TMPFS_MAGIC) ||
+                F_TYPE_EQUAL(s->f_type, RAMFS_MAGIC);
 }
 
 int rm_rf_children(int fd, bool only_dirs, bool honour_sticky, struct stat *root_dev) {