Rename F_TYPE_CMP() to F_TYPE_EQUAL()
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+2
-2
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user