diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-05-27 19:10:40 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-05-27 19:10:40 +0000 |
commit | 70616853600900cb04a615ac620792553dbe1c7d (patch) | |
tree | fa1bff7d0b322944b98459c80ffe9bd8f2fa3ba9 /nuttx/examples/mount | |
parent | 9f53bc85a64da31a21ede71a112f2f6c0486417b (diff) | |
download | px4-nuttx-70616853600900cb04a615ac620792553dbe1c7d.tar.gz px4-nuttx-70616853600900cb04a615ac620792553dbe1c7d.tar.bz2 px4-nuttx-70616853600900cb04a615ac620792553dbe1c7d.zip |
Fix reference count problem
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@258 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples/mount')
-rw-r--r-- | nuttx/examples/mount/mount_main.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/nuttx/examples/mount/mount_main.c b/nuttx/examples/mount/mount_main.c index 184c1fcc0..716b4d9a9 100644 --- a/nuttx/examples/mount/mount_main.c +++ b/nuttx/examples/mount/mount_main.c @@ -53,6 +53,9 @@ * Definitions ****************************************************************************/ +#define TEST_USE_STAT 1 +#define TEST_SHOW_DIRECTORIES 1 + /**************************************************************************** * Private Types ****************************************************************************/ @@ -83,6 +86,7 @@ static char g_namebuffer[256]; * Private Functions ****************************************************************************/ +#ifdef TEST_USE_STAT static void show_stat(const char *path, struct stat *ps) { printf("%s stat:\n", path); @@ -111,15 +115,17 @@ static void show_stat(const char *path, struct stat *ps) printf("\tsize : %d (bytes)\n", ps->st_size); printf("\tblock size : %d (bytes)\n", ps->st_blksize); printf("\tsize : %d (blocks)\n", ps->st_blocks); - printf("\taccess time : %d (blocks)\n", ps->st_atime); - printf("\tmodify time : %d (blocks)\n", ps->st_mtime); - printf("\tchange time : %d (blocks)\n", ps->st_ctime); + printf("\taccess time : %d\n", ps->st_atime); + printf("\tmodify time : %d\n", ps->st_mtime); + printf("\tchange time : %d\n", ps->st_ctime); } +#endif /**************************************************************************** * Name: show_directories ****************************************************************************/ +#ifdef TEST_SHOW_DIRECTORIES static void show_directories(const char *path, int indent) { DIR *dirp; @@ -157,6 +163,9 @@ static void show_directories(const char *path, int indent) closedir(dirp); } +#else +# define show_directories(p,i) +#endif /**************************************************************************** * Name: fail_read_open @@ -446,6 +455,7 @@ static void succeed_rename(const char *oldpath, const char *newpath) * Name: fail_stat ****************************************************************************/ +#ifdef TEST_USE_STAT static void fail_stat(const char *path, int expectederror) { struct stat buf; @@ -469,11 +479,15 @@ static void fail_stat(const char *path, int expectederror) g_nerrors++; } } +#else +# define fail_stat(p,e); +#endif /**************************************************************************** * Name: succeed_stat ****************************************************************************/ +#ifdef TEST_USE_STAT static void succeed_stat(const char *path) { struct stat buf; @@ -494,6 +508,9 @@ static void succeed_stat(const char *path) show_stat(path, &buf); } } +#else +#define succeed_stat(p) +#endif /**************************************************************************** * Public Functions |