From 2a714e4586d64d71214e71aa66e944fa09a9d452 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 11 Oct 2019 21:40:23 -0700 Subject: [PATCH] adjust S_IFIFO to avoid collisions S_IFIFO currently has the same value as S_IFSOCK which breaks code that does things like "switch (mode & S_IFMT)" as we end up with duplicate labels. Move S_IFIFO to a unique unused value. --- expected/wasm32-wasi/predefined-macros.txt | 2 +- libc-bottom-half/headers/public/__mode_t.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/expected/wasm32-wasi/predefined-macros.txt b/expected/wasm32-wasi/predefined-macros.txt index d7d7c65f2..28a7726e3 100644 --- a/expected/wasm32-wasi/predefined-macros.txt +++ b/expected/wasm32-wasi/predefined-macros.txt @@ -1717,7 +1717,7 @@ #define S_IFBLK (0x6000) #define S_IFCHR (0x2000) #define S_IFDIR (0x4000) -#define S_IFIFO (0xc000) +#define S_IFIFO (0x1000) #define S_IFLNK (0xa000) #define S_IFMT (S_IFBLK | S_IFCHR | S_IFDIR | S_IFIFO | S_IFLNK | S_IFREG | S_IFSOCK) #define S_IFREG (0x8000) diff --git a/libc-bottom-half/headers/public/__mode_t.h b/libc-bottom-half/headers/public/__mode_t.h index c0beef537..d2dbe0471 100644 --- a/libc-bottom-half/headers/public/__mode_t.h +++ b/libc-bottom-half/headers/public/__mode_t.h @@ -9,7 +9,7 @@ #define S_IFLNK (0xa000) #define S_IFREG (0x8000) #define S_IFSOCK (0xc000) -#define S_IFIFO (0xc000) +#define S_IFIFO (0x1000) #define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK) #define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR)