This patch brings common Makefile (in terms of mtd-utils project) to the
checkfs test suite. Additionally it fixes a build error related to usage of
open().
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
+TARGETS = checkfs makefiles
-all: checkfs makefiles
+include ../../common.mk
-checkfs: checkfs.c Makefile common.h comm.o
- gcc -g -Wall checkfs.c comm.o -o checkfs
+$(TARGETS): $(addprefix $(BUILDDIR)/, comm.o)
-comm.o: comm.c Makefile
- gcc -g -Wall -c comm.c -o comm.o
-
-makefiles: makefiles.c Makefile common.h
- gcc -g -Wall makefiles.c -o makefiles
-
-clean:
- rm -f makefiles checkfs *~ *.o
fprintf(stderr, "Creating File:%s. ", filename);
- if((dfd = open(filename, O_RDWR | O_CREAT | O_SYNC)) <= 0)
+ if((dfd = open(filename, O_RDWR | O_CREAT | O_SYNC, S_IRWXU)) <= 0)
{
printf("Error! Cannot open file: %s\n",filename);
perror("Error");