diff mbox

[PATCHv1,4/5] tests: checkfs: adjust Makefile

Message ID 6cb173d447de7eb92ead54f450da7752a40e476c.1302700658.git.ext-andriy.shevchenko@nokia.com
State Accepted
Commit ae385163f7278dd67dbe3d133d37ff3aabece1ad
Headers show

Commit Message

Shevchenko Andriy (EXT-Teleca/Helsinki) April 13, 2011, 1:20 p.m. UTC
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>
---
 tests/checkfs/Makefile  |   14 +++-----------
 tests/checkfs/checkfs.c |    2 +-
 2 files changed, 4 insertions(+), 12 deletions(-)

Comments

Artem Bityutskiy April 14, 2011, 12:28 p.m. UTC | #1
On Wed, 2011-04-13 at 16:20 +0300, Andy Shevchenko wrote:
> 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>
> ---
>  tests/checkfs/Makefile  |   14 +++-----------
>  tests/checkfs/checkfs.c |    2 +-
>  2 files changed, 4 insertions(+), 12 deletions(-)

You should not mix makefile and code changes. But well, not so big deal
in this case, pushed, thanks!
diff mbox

Patch

diff --git a/tests/checkfs/Makefile b/tests/checkfs/Makefile
index ac94dde..0a77682 100644
--- a/tests/checkfs/Makefile
+++ b/tests/checkfs/Makefile
@@ -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
diff --git a/tests/checkfs/checkfs.c b/tests/checkfs/checkfs.c
index 3224d2b..8e74da8 100644
--- a/tests/checkfs/checkfs.c
+++ b/tests/checkfs/checkfs.c
@@ -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");