]> www.infradead.org Git - mtd-utils.git/commitdiff
tests: checkfs: adjust Makefile
authorAndy Shevchenko <ext-andriy.shevchenko@nokia.com>
Wed, 13 Apr 2011 13:20:28 +0000 (16:20 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Thu, 14 Apr 2011 12:33:46 +0000 (15:33 +0300)
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>
tests/checkfs/Makefile
tests/checkfs/checkfs.c

index ac94dde8c5b14a3782f2243f67c068e1aabffa59..0a7768299aab77137739f9971a49c2165051561e 100644 (file)
@@ -1,14 +1,6 @@
+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
index 3224d2b996b34fdde695995d3025362e81009edb..8e74da80153377b76836543acda66f04aefb0de3 100644 (file)
@@ -414,7 +414,7 @@ void make_new_file(char *filename){
 
     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");