From: Zbigniew Jędrzejewski-Szmek Date: Fri, 16 Aug 2013 03:13:48 +0000 (-0400) Subject: Rename F_TYPE_CMP() to F_TYPE_EQUAL() X-Git-Tag: v207~101 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=c51cf05646a11c65daf65c1123c77efb068f4f7b;ds=sidebyside Rename F_TYPE_CMP() to F_TYPE_EQUAL() --- diff --git a/TODO b/TODO index 5c5e4b46f..9bc14fdbf 100644 --- 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 diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c index 5c0e45533..880661e27 100644 --- a/src/gpt-auto-generator/gpt-auto-generator.c +++ b/src/gpt-auto-generator/gpt-auto-generator.c @@ -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; diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c index a83c0c25b..7700d6cb1 100644 --- a/src/journal/sd-journal.c +++ b/src/journal/sd-journal.c @@ -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) { diff --git a/src/readahead/readahead-collect.c b/src/readahead/readahead-collect.c index 5d37bb75f..32888add0 100644 --- a/src/readahead/readahead-collect.c +++ b/src/readahead/readahead-collect.c @@ -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) { diff --git a/src/shared/macro.h b/src/shared/macro.h index 969329d15..0d3ff1cda 100644 --- a/src/shared/macro.h +++ b/src/shared/macro.h @@ -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 diff --git a/src/shared/util.c b/src/shared/util.c index f23dd92a6..ca9c2eb9d 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -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) {