修复mac上cpio打包问题

This commit is contained in:
zhangzheng
2023-12-15 23:15:33 +08:00
parent bce83c3682
commit 6f3827a866
5 changed files with 19 additions and 15 deletions

View File

@@ -66,11 +66,10 @@ int cpio_find_next(umword_t st, const char *pre_name,
int name_size = htoi(file_info->c_namesize, 8);
mode = htoi(file_info->c_mode, 8);
const char *f_name = (char *)(i + sizeof(cpio_fs_t));
if (strcmp("TRAILER!!", f_name) == 0)
if (strcmp("TRAILER!!!", f_name) == 0)
{
return -1;
}
if (strncmp(f_name, pre_name, strlen(pre_name)) == 0)
{
if (S_ISDIR(mode))
@@ -117,7 +116,6 @@ int cpio_find_file(umword_t st, umword_t en, const char *name, umword_t *size, i
int name_size = htoi(file_info->c_namesize, 8);
mode = htoi(file_info->c_mode, 8);
const char *f_name = (char *)(i + sizeof(cpio_fs_t));
// printf("%s\n", f_name);
if (name[0] == '\0')
{
if (type)

View File

@@ -63,13 +63,19 @@ msg_tag_t thread_ipc_reply(msg_tag_t in_tag, ipc_timeout_t timeout);
msg_tag_t thread_ipc_send(msg_tag_t in_tag, obj_handler_t target_th_obj, ipc_timeout_t timeout);
msg_tag_t thread_ipc_call(msg_tag_t in_tag, obj_handler_t target_th_obj, ipc_timeout_t timeout);
#define thread_get_cur_ipc_msg() \
( \
{ \
umword_t buf; \
thread_msg_buf_get(-1, &buf, NULL); \
((ipc_msg_t *)buf); \
})
// #define thread_get_cur_ipc_msg() \
// ( \
// { \
// umword_t buf; \
// thread_msg_buf_get(-1, &buf, NULL); \
// ((ipc_msg_t *)buf); \
// })
static inline ipc_msg_t *thread_get_cur_ipc_msg(void)
{
umword_t buf;
thread_msg_buf_get(-1, &buf, NULL);
return (ipc_msg_t *)buf;
}
#define thread_get_src_pid() thread_get_cur_ipc_msg()->user[2]
#define thread_set_src_pid(pid) thread_get_cur_ipc_msg()->user[2] = pid