btrfs-progs: fssum: fix warning, include correct header for major()
authorDavid Sterba <dsterba@suse.com>
Tue, 2 May 2017 14:23:54 +0000 (16:23 +0200)
committerDavid Sterba <dsterba@suse.com>
Tue, 2 May 2017 14:23:54 +0000 (16:23 +0200)
tests/fssum.c:599:13: warning: In the GNU C Library, "major" is defined
 by <sys/sysmacros.h>. For historical compatibility, it is
 currently defined by <sys/types.h> as well, but we plan to
 remove this soon. To use "major", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "major", you should undefine it after including <sys/types.h>.
    sum_add_u64(&cs, major(st.st_rdev));

Signed-off-by: David Sterba <dsterba@suse.com>
tests/fssum.c

index 8be4454..5dde998 100644 (file)
@@ -24,6 +24,7 @@
 #include <fcntl.h>
 #include <dirent.h>
 #include <errno.h>
+#include <sys/sysmacros.h>
 #include <sys/stat.h>
 #include <assert.h>
 #include <time.h>