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:
@@ -27,7 +27,7 @@ UsePrivateHeaders [ FDirName kernel ] ; # For kernel_cpp.cpp
|
|||||||
|
|
||||||
BinCommand copy_to_bfs_image :
|
BinCommand copy_to_bfs_image :
|
||||||
copy_to_bfs_image.cpp rootfs.c initfs.c kernel.c cache.c sl.c stub.c
|
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
|
Volume.cpp BPlusTree.cpp Inode.cpp Index.cpp Query.cpp Journal.cpp
|
||||||
BlockAllocator.cpp kernel_interface_r5.cpp Utility.cpp BufferPool.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 ] ;
|
] = [ FDirName $(OBOS_TOP) src system libroot posix string ] ;
|
||||||
|
|
||||||
SEARCH on [ FGristFiles
|
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 ] ;
|
] = [ FDirName $(OBOS_TOP) src tests add-ons kernel file_systems fs_shell ] ;
|
||||||
|
|||||||
@@ -154,19 +154,19 @@ copy(const char *from, const char *to)
|
|||||||
return errno;
|
return errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct stat toStat;
|
struct my_stat toStat;
|
||||||
status_t status = sys_rstat(1, -1, toPath, &toStat, 1);
|
status_t status = sys_rstat(1, -1, toPath, &toStat, 1);
|
||||||
// will be evaluated later
|
// will be evaluated later
|
||||||
|
|
||||||
if (S_ISDIR(fromStat.st_mode)) {
|
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);
|
fprintf(stderr, "Target \"%s\" is not a directory\n.", to);
|
||||||
return B_NOT_A_DIRECTORY;
|
return B_NOT_A_DIRECTORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
return copy_dir(from, toPath);
|
return copy_dir(from, toPath);
|
||||||
} else if (status == B_OK) {
|
} else if (status == B_OK) {
|
||||||
if (S_ISREG(toStat.st_mode)) {
|
if (S_ISREG(toStat.mode)) {
|
||||||
// overwrite target file
|
// overwrite target file
|
||||||
return copy_file(from, fromStat, toPath);
|
return copy_file(from, fromStat, toPath);
|
||||||
} else {
|
} else {
|
||||||
@@ -284,8 +284,12 @@ main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sys_unmount(1, -1, "/myfs") != 0) {
|
sys_sync();
|
||||||
printf("could not un-mount /myfs\n");
|
|
||||||
|
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;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user