[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] tools/libfsimage: Fix PATH_MAX redefinition error



commit d276e0f3f14f2d46f27989008770eb2b9c678bc4
Author:     Costin Lupu <costin.lupu@xxxxxxxxx>
AuthorDate: Tue Jun 8 15:35:26 2021 +0300
Commit:     Julien Grall <jgrall@xxxxxxxxxx>
CommitDate: Fri Jul 9 15:59:59 2021 +0100

    tools/libfsimage: Fix PATH_MAX redefinition error
    
    If PATH_MAX is already defined in the system (e.g. in /usr/include/limits.h
    header) then gcc will trigger a redefinition error because of -Werror.
    
    Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
    Reviewed-by: Julien Grall <jgrall@xxxxxxxxxx>
    Acked-by: Ian Jackson <iwj@xxxxxxxxxxxxxx>
---
 tools/libfsimage/ext2fs/fsys_ext2fs.c     | 2 ++
 tools/libfsimage/reiserfs/fsys_reiserfs.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/tools/libfsimage/ext2fs/fsys_ext2fs.c 
b/tools/libfsimage/ext2fs/fsys_ext2fs.c
index a4ed10419c..5ed8fce90e 100644
--- a/tools/libfsimage/ext2fs/fsys_ext2fs.c
+++ b/tools/libfsimage/ext2fs/fsys_ext2fs.c
@@ -278,7 +278,9 @@ struct ext4_extent_header {
 
 #define EXT2_SUPER_MAGIC      0xEF53   /* include/linux/ext2_fs.h */
 #define EXT2_ROOT_INO              2   /* include/linux/ext2_fs.h */
+#ifndef PATH_MAX
 #define PATH_MAX                1024   /* include/linux/limits.h */
+#endif
 #define MAX_LINK_COUNT             5   /* number of symbolic links to follow */
 
 /* made up, these are pointers into FSYS_BUF */
diff --git a/tools/libfsimage/reiserfs/fsys_reiserfs.c 
b/tools/libfsimage/reiserfs/fsys_reiserfs.c
index 916eb15292..10ca657476 100644
--- a/tools/libfsimage/reiserfs/fsys_reiserfs.c
+++ b/tools/libfsimage/reiserfs/fsys_reiserfs.c
@@ -284,7 +284,9 @@ struct reiserfs_de_head
 #define S_ISDIR(mode) (((mode) & 0170000) == 0040000)
 #define S_ISLNK(mode) (((mode) & 0170000) == 0120000)
 
+#ifndef PATH_MAX
 #define PATH_MAX       1024    /* include/linux/limits.h */
+#endif
 #define MAX_LINK_COUNT    5    /* number of symbolic links to follow */
 
 /* The size of the node cache */
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.