summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2005-08-16 09:32:45 +0200
committerWolfgang Denk <wd@pollux.denx.de>2005-08-16 09:32:45 +0200
commit87b8bd5aed0d2a71cf77c7178d67a370a0f68612 (patch)
treee978edbddfee197210d25c78973a12e56896057f
parent3d078ce6d786df932a0c00b8a95c0179c616ebc1 (diff)
downloadu-boot-87b8bd5aed0d2a71cf77c7178d67a370a0f68612.tar.gz
u-boot-87b8bd5aed0d2a71cf77c7178d67a370a0f68612.tar.bz2
u-boot-87b8bd5aed0d2a71cf77c7178d67a370a0f68612.zip
Fix return values of the jffs2 commands ls/fsload/fsinfo,
so we can use them to, e.g., check the existence of a file with "if ls foo; then this; else that; fi" in the hush shell Patch by Andreas Engel, 16 August 2005
-rw-r--r--CHANGELOG5
-rw-r--r--common/cmd_jffs2.c10
-rw-r--r--fs/jffs2/jffs2_1pass.c4
3 files changed, 12 insertions, 7 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 69214c3a03..51c09eec2c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,11 @@
Changes for U-Boot 1.1.4:
======================================================================
+* Fix return values of the jffs2 commands ls/fsload/fsinfo,
+ so we can use them to, e.g., check the existence of a file with
+ "if ls foo; then this; else that; fi" in the hush shell
+ Patch by Andreas Engel, 16 August 2005
+
* Coding style cleanup
* Add support for Silicon Turnkey eXpress XTc (mpc87x/88x) board.
diff --git a/common/cmd_jffs2.c b/common/cmd_jffs2.c
index 16f5b7aea9..7ab6e9ca7a 100644
--- a/common/cmd_jffs2.c
+++ b/common/cmd_jffs2.c
@@ -1810,7 +1810,7 @@ int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return !(size > 0);
}
- return 0;
+ return 1;
}
/**
@@ -1846,9 +1846,9 @@ int do_jffs2_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
ret = jffs2_1pass_ls(part, filename);
}
- return (ret == 1);
+ return ret ? 0 : 1;
}
- return 0;
+ return 1;
}
/**
@@ -1884,9 +1884,9 @@ int do_jffs2_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
ret = jffs2_1pass_info(part);
}
- return (ret == 1);
+ return ret ? 0 : 1;
}
- return 0;
+ return 1;
}
/* command line only */
diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
index 667ae15e6d..e53aa31eff 100644
--- a/fs/jffs2/jffs2_1pass.c
+++ b/fs/jffs2/jffs2_1pass.c
@@ -1288,7 +1288,7 @@ u32
jffs2_1pass_ls(struct part_info * part, const char *fname)
{
struct b_lists *pl;
- long ret = 0;
+ long ret = 1;
u32 inode;
if (! (pl = jffs2_get_list(part, "ls")))
@@ -1315,7 +1315,7 @@ jffs2_1pass_load(char *dest, struct part_info * part, const char *fname)
{
struct b_lists *pl;
- long ret = 0;
+ long ret = 1;
u32 inode;
if (! (pl = jffs2_get_list(part, "load")))