diff --git a/apps/config.mk b/apps/config.mk index 3668875b..51e9e219 100644 --- a/apps/config.mk +++ b/apps/config.mk @@ -30,7 +30,7 @@ include $(LITEOSTOPDIR)/config.mk # common flags config -BASE_OPTS := -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE +BASE_OPTS := -D_FORTIFY_SOURCE=2 -D_XOPEN_SOURCE=700 ASFLAGS := CFLAGS := $(LITEOS_COPTS) $(BASE_OPTS) -fPIE diff --git a/apps/shell/builtin/cd.c b/apps/shell/builtin/cd.c index 9992f45f..f1e11949 100644 --- a/apps/shell/builtin/cd.c +++ b/apps/shell/builtin/cd.c @@ -29,9 +29,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _GNU_SOURCE #define _GNU_SOURCE -#endif #include "unistd.h" #include "shcmd.h" diff --git a/apps/shell/src/main.c b/apps/shell/src/main.c index 8401c0ca..0d08fa5e 100644 --- a/apps/shell/src/main.c +++ b/apps/shell/src/main.c @@ -29,6 +29,8 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#define _GNU_SOURCE + #include "show.h" #include "shmsg.h" #include "shcmd.h" diff --git a/apps/shell/src/shmsg.c b/apps/shell/src/shmsg.c index b4f237ba..795951d1 100644 --- a/apps/shell/src/shmsg.c +++ b/apps/shell/src/shmsg.c @@ -29,6 +29,8 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#define _GNU_SOURCE + #include "stdlib.h" #include "stdio.h" #include "unistd.h"