diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-05-22 10:34:31 +0300 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2017-05-25 19:34:53 +0300 |
commit | 2693c1db694f515d7b59ec8057e01942c212b8c1 (patch) | |
tree | 3382a329fefecd2a585100a4eb3d6ef67fc21cd1 /newlib/libc/machine | |
parent | 0008601042291502e479fd0d2738855b40f9b2b2 (diff) |
Move ARM access.c from machine to sys
The implementation of the POSIX access() function is nothing machine
specific like memcpy(), etc. Move it back to the system domain. This
avoids problems due to the include search order of the Newlib/GCC build
which picks up machine includes before system includes.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Diffstat (limited to 'newlib/libc/machine')
-rw-r--r-- | newlib/libc/machine/arm/Makefile.am | 2 | ||||
-rw-r--r-- | newlib/libc/machine/arm/Makefile.in | 13 | ||||
-rw-r--r-- | newlib/libc/machine/arm/access.c | 33 |
3 files changed, 4 insertions, 44 deletions
diff --git a/newlib/libc/machine/arm/Makefile.am b/newlib/libc/machine/arm/Makefile.am index 6b6705027..9bd35e733 100644 --- a/newlib/libc/machine/arm/Makefile.am +++ b/newlib/libc/machine/arm/Makefile.am @@ -8,7 +8,7 @@ AM_CCASFLAGS = $(INCLUDES) noinst_LIBRARIES = lib.a -lib_a_SOURCES = setjmp.S access.c strcmp.S strcpy.c \ +lib_a_SOURCES = setjmp.S strcmp.S strcpy.c \ aeabi_memcpy.c aeabi_memcpy-armv7a.S \ aeabi_memmove.c aeabi_memmove-soft.S \ aeabi_memset.c aeabi_memset-soft.S aeabi_memclr.c diff --git a/newlib/libc/machine/arm/Makefile.in b/newlib/libc/machine/arm/Makefile.in index a0e4cc2bd..d9dbcd5c3 100644 --- a/newlib/libc/machine/arm/Makefile.in +++ b/newlib/libc/machine/arm/Makefile.in @@ -69,9 +69,8 @@ LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru lib_a_AR = $(AR) $(ARFLAGS) lib_a_LIBADD = -am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT) lib_a-access.$(OBJEXT) \ - lib_a-strcmp.$(OBJEXT) lib_a-strcpy.$(OBJEXT) \ - lib_a-aeabi_memcpy.$(OBJEXT) \ +am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT) lib_a-strcmp.$(OBJEXT) \ + lib_a-strcpy.$(OBJEXT) lib_a-aeabi_memcpy.$(OBJEXT) \ lib_a-aeabi_memcpy-armv7a.$(OBJEXT) \ lib_a-aeabi_memmove.$(OBJEXT) \ lib_a-aeabi_memmove-soft.$(OBJEXT) \ @@ -206,7 +205,7 @@ AUTOMAKE_OPTIONS = cygnus INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) AM_CCASFLAGS = $(INCLUDES) noinst_LIBRARIES = lib.a -lib_a_SOURCES = setjmp.S access.c strcmp.S strcpy.c aeabi_memcpy.c \ +lib_a_SOURCES = setjmp.S strcmp.S strcpy.c aeabi_memcpy.c \ aeabi_memcpy-armv7a.S aeabi_memmove.c aeabi_memmove-soft.S \ aeabi_memset.c aeabi_memset-soft.S aeabi_memclr.c \ memchr-stub.c memchr.S memcpy-stub.c memcpy.S strlen-stub.c \ @@ -338,12 +337,6 @@ lib_a-strlen.obj: strlen.S .c.obj: $(COMPILE) -c `$(CYGPATH_W) '$<'` -lib_a-access.o: access.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-access.o `test -f 'access.c' || echo '$(srcdir)/'`access.c - -lib_a-access.obj: access.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-access.obj `if test -f 'access.c'; then $(CYGPATH_W) 'access.c'; else $(CYGPATH_W) '$(srcdir)/access.c'; fi` - lib_a-strcpy.o: strcpy.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcpy.o `test -f 'strcpy.c' || echo '$(srcdir)/'`strcpy.c diff --git a/newlib/libc/machine/arm/access.c b/newlib/libc/machine/arm/access.c deleted file mode 100644 index 980682ef3..000000000 --- a/newlib/libc/machine/arm/access.c +++ /dev/null @@ -1,33 +0,0 @@ -/* This is file ACCESS.C */ -/* - * Copyright (C) 1993 DJ Delorie - * All rights reserved. - * - * Redistribution, modification, and use in source and binary forms is permitted - * provided that the above copyright notice and following paragraph are - * duplicated in all such forms. - * - * This file is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include <fcntl.h> -#include <sys/stat.h> -#include <unistd.h> - -int access(const char *fn, int flags) -{ - struct stat s; - if (stat(fn, &s)) - return -1; - if (s.st_mode & S_IFDIR) - return 0; - if (flags & W_OK) - { - if (s.st_mode & S_IWRITE) - return 0; - return -1; - } - return 0; -} - |