Signed-off-by: Xiangfu Liu <[email protected]>
---
Hi Sebastien
this patch fixe the https://github.com/milkymist/bugs/issues/17
but it still give a warning like:
[/ramdisk] # mv a /ssd/g
/ssd/g: set mode: Not supported <--
cpukit/libmisc/shell/main_mv.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/cpukit/libmisc/shell/main_mv.c b/cpukit/libmisc/shell/main_mv.c
index 644900b..524a35d 100644
--- a/cpukit/libmisc/shell/main_mv.c
+++ b/cpukit/libmisc/shell/main_mv.c
@@ -330,7 +330,7 @@ fastcopy_mv(rtems_shell_mv_globals* globals, char *from,
char *to, struct stat *
static char *bp;
int nread, from_fd, to_fd;
- blen = 0;
+ blen = 1024;
if ((from_fd = open(from, O_RDONLY, 0)) < 0) {
warn("%s", from);
@@ -342,7 +342,9 @@ fastcopy_mv(rtems_shell_mv_globals* globals, char *from,
char *to, struct stat *
(void)close(from_fd);
return (1);
}
- if (!blen && !(bp = malloc(blen = sbp->st_blksize))) {
+ if (sbp->st_blksize != 0)
+ blen = sbp->st_blksize;
+ if (!(bp = malloc(blen))) {
warn(NULL);
blen = 0;
(void)close(from_fd);
--
1.7.0.4
_______________________________________________
http://lists.milkymist.org/listinfo.cgi/devel-milkymist.org
IRC: #milkymist@Freenode
Twitter: www.twitter.com/milkymistvj
Ideas? http://milkymist.uservoice.com