[systemd-devel] [PATCH] basic: fix build on architectures with small long

Helmut Grohne helmut at subdivi.de
Sat Nov 21 23:43:08 PST 2015

I was asked to use NULL instead of 0 and to send a pull request. So see
my git-pull-request below. Please do Cc me in your replies rather than
relaying them e.g. via IRC.


The following changes since commit bb54817f3bbe9043326b72a848384491314d428d:

  Merge pull request #1947 from phomes/sort-includes2 (2015-11-19 23:32:30 +0100)

are available in the git repository at:

  git://git.subdivi.de/~helmut/systemd.git fix-build-failure

for you to fetch changes up to 16134b6977dc5b63c12eabe665bc5eb66e741265:

  basic: fix build on architectures with small long (2015-11-22 08:22:22 +0100)

Helmut Grohne (1):
      basic: fix build on architectures with small long

 src/basic/stat-util.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/basic/stat-util.h b/src/basic/stat-util.h
index 909b220..fb92464 100644
--- a/src/basic/stat-util.h
+++ b/src/basic/stat-util.h
@@ -52,9 +52,8 @@ int path_is_os_tree(const char *path);
 int files_same(const char *filea, const char *fileb);
 /* The .f_type field of struct statfs is really weird defined on
- * different archs. Let's use our own type we know is sufficiently
- * larger to store the possible values. */
-typedef long statfs_f_type_t;
+ * different archs. Let's give its type a name. */
+typedef typeof(((struct statfs*)NULL)->f_type) statfs_f_type_t;
 bool is_fs_type(const struct statfs *s, statfs_f_type_t magic_value) _pure_;
 int fd_check_fstype(int fd, statfs_f_type_t magic_value);

More information about the systemd-devel mailing list