Kernel: Don't fail ustar unpack when creation fails
This commit is contained in:
parent
f82390424b
commit
d8a695a88d
|
@ -109,7 +109,8 @@ namespace Kernel
|
||||||
|
|
||||||
if (file_type == DIRTYPE)
|
if (file_type == DIRTYPE)
|
||||||
{
|
{
|
||||||
TRY(parent_inode->create_directory(file_name_sv, file_mode, file_uid, file_gid));
|
if (auto ret = parent_inode->create_directory(file_name_sv, file_mode, file_uid, file_gid); ret.is_error())
|
||||||
|
dwarnln("failed to create directory '{}': {}", file_name_sv, ret.error());
|
||||||
}
|
}
|
||||||
else if (file_type == LNKTYPE)
|
else if (file_type == LNKTYPE)
|
||||||
{
|
{
|
||||||
|
@ -117,8 +118,10 @@ namespace Kernel
|
||||||
}
|
}
|
||||||
else if (file_type == SYMTYPE)
|
else if (file_type == SYMTYPE)
|
||||||
{
|
{
|
||||||
TRY(parent_inode->create_file(file_name_sv, file_mode, file_uid, file_gid));
|
if (auto ret = parent_inode->create_file(file_name_sv, file_mode, file_uid, file_gid); ret.is_error())
|
||||||
|
dwarnln("failed to create symlink '{}': {}", file_name_sv, ret.error());
|
||||||
|
else
|
||||||
|
{
|
||||||
char link_target[101] {};
|
char link_target[101] {};
|
||||||
const paddr_t paddr = module.start + offset;
|
const paddr_t paddr = module.start + offset;
|
||||||
PageTable::with_fast_page(paddr & PAGE_ADDR_MASK, [&] {
|
PageTable::with_fast_page(paddr & PAGE_ADDR_MASK, [&] {
|
||||||
|
@ -131,10 +134,13 @@ namespace Kernel
|
||||||
TRY(inode->set_link_target(link_target));
|
TRY(inode->set_link_target(link_target));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (auto ret = parent_inode->create_file(file_name_sv, file_mode, file_uid, file_gid); ret.is_error())
|
||||||
|
dwarnln("failed to create file '{}': {}", file_name_sv, ret.error());
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TRY(parent_inode->create_file(file_name_sv, file_mode, file_uid, file_gid));
|
|
||||||
|
|
||||||
if (file_size)
|
if (file_size)
|
||||||
{
|
{
|
||||||
auto inode = TRY(parent_inode->find_inode(file_name_sv));
|
auto inode = TRY(parent_inode->find_inode(file_name_sv));
|
||||||
|
@ -154,6 +160,7 @@ namespace Kernel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
offset += 512 + file_size;
|
offset += 512 + file_size;
|
||||||
if (auto rem = offset % 512)
|
if (auto rem = offset % 512)
|
||||||
|
|
Loading…
Reference in New Issue