summaryrefslogtreecommitdiff
path: root/src/basic/stat-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-27 01:26:52 +0100
committerLennart Poettering <lennart@poettering.net>2015-10-27 13:25:58 +0100
commit872a590ef83b23a65071242a8082d25d5efa6db6 (patch)
treec4a7eec4c52124dc7b32d8fe698e3d04387147f4 /src/basic/stat-util.h
parent15a5e95075a7f6007dd97b2a165c8ed16fe683df (diff)
stat-util.h: move F_TYPE_EQUAL() macro definition to stat-util.h
Diffstat (limited to 'src/basic/stat-util.h')
-rw-r--r--src/basic/stat-util.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/basic/stat-util.h b/src/basic/stat-util.h
index cb00e0f564..82edea06a8 100644
--- a/src/basic/stat-util.h
+++ b/src/basic/stat-util.h
@@ -61,3 +61,9 @@ int path_check_fstype(const char *path, statfs_f_type_t magic_value);
bool is_temporary_fs(const struct statfs *s) _pure_;
int fd_is_temporary_fs(int fd);
+
+/* Because statfs.t_type can be int on some architectures, we have to cast
+ * 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_EQUAL(a, b) (a == (typeof(a)) b)