use setitimer instead of alarm, and print message.

print_stat now prints messages per interval.
ToDo:
- realtime message printing
- use timer_create instead of setitimer (mscOS has different one)
This commit is contained in:
Ryo Nakamura
2023-03-04 16:48:26 +09:00
parent f9c8dec389
commit e67b7468e5
2 changed files with 51 additions and 5 deletions

View File

@@ -198,13 +198,13 @@ struct mscp *mscp_init(const char *remote_host,
return NULL;
}
m->msg_fd = o->msg_fd;
mprint_set_severity(o->severity);
if (validate_and_set_defaut_params(o) < 0)
goto free_out;
memset(m, 0, sizeof(*m));
m->msg_fd = o->msg_fd;
INIT_LIST_HEAD(&m->src_list);
INIT_LIST_HEAD(&m->path_list);
INIT_LIST_HEAD(&m->chunk_list);
@@ -220,7 +220,7 @@ struct mscp *mscp_init(const char *remote_host,
goto free_out;
mpr_notice(m->msg_fd, "usable cpu cores:");
for (n = 0; n < m->nr_cores; n++)
mpr_notice(m->msg_fd, "%d", m->cores[n]);
mpr_notice(m->msg_fd, " %d", m->cores[n]);
mpr_notice(m->msg_fd, "\n");
}