Made copy_to_bfs_image compile and work again after Ingo's changes to

the fs_shell (some months ago, but no one noticed yet)...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13857 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-07-29 14:07:49 +00:00
parent 02cf6d0008
commit c64fca3e22
2 changed files with 11 additions and 7 deletions

View File

@ -27,7 +27,7 @@ UsePrivateHeaders [ FDirName kernel ] ; # For kernel_cpp.cpp
BinCommand copy_to_bfs_image :
copy_to_bfs_image.cpp rootfs.c initfs.c kernel.c cache.c sl.c stub.c
sysdep.c hexdump.c argv.c
sysdep.c hexdump.c argv.c errors.cpp
Volume.cpp BPlusTree.cpp Inode.cpp Index.cpp Query.cpp Journal.cpp
BlockAllocator.cpp kernel_interface_r5.cpp Utility.cpp BufferPool.cpp
@ -53,5 +53,5 @@ SEARCH on [ FGristFiles
] = [ FDirName $(OBOS_TOP) src system libroot posix string ] ;
SEARCH on [ FGristFiles
rootfs.c initfs.c kernel.c cache.c sl.c stub.c sysdep.c hexdump.c argv.c
rootfs.c initfs.c kernel.c cache.c sl.c stub.c sysdep.c hexdump.c argv.c errors.cpp
] = [ FDirName $(OBOS_TOP) src tests add-ons kernel file_systems fs_shell ] ;

View File

@ -154,19 +154,19 @@ copy(const char *from, const char *to)
return errno;
}
struct stat toStat;
struct my_stat toStat;
status_t status = sys_rstat(1, -1, toPath, &toStat, 1);
// will be evaluated later
if (S_ISDIR(fromStat.st_mode)) {
if (S_ISREG(toStat.st_mode)) {
if (S_ISREG(toStat.mode)) {
fprintf(stderr, "Target \"%s\" is not a directory\n.", to);
return B_NOT_A_DIRECTORY;
}
return copy_dir(from, toPath);
} else if (status == B_OK) {
if (S_ISREG(toStat.st_mode)) {
if (S_ISREG(toStat.mode)) {
// overwrite target file
return copy_file(from, fromStat, toPath);
} else {
@ -284,8 +284,12 @@ main(int argc, char **argv)
break;
}
if (sys_unmount(1, -1, "/myfs") != 0) {
printf("could not un-mount /myfs\n");
sys_sync();
sys_chdir(1, -1, "/");
status_t status = sys_unmount(1, -1, "/myfs");
if (status != B_OK) {
printf("could not un-mount /myfs: %s\n", fs_strerror(status));
return 5;
}