Skip to content

Commit

Permalink
♻️ refactor open flag log
Browse files Browse the repository at this point in the history
  • Loading branch information
froz42 committed Oct 15, 2023
1 parent c08ba23 commit 3967cb5
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions srcs/syscall/param_log/log_open_flags.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,5 @@ static const flag_str_t flags[] = {
*/
int log_OPEN_FLAGS(uint64_t value)
{
int size_written = 0;
bool_t first = true;
for (size_t i = 0; i < ELEM_COUNT(flags); i++)
{
if (value & flags[i].flag)
{
if (!first)
size_written += ft_dprintf(STDERR_FILENO, "|");
size_written += ft_dprintf(STDERR_FILENO, "%s", flags[i].str);
first = false;
value &= ~flags[i].flag;
}
}
if (value)
{
if (!first)
size_written += ft_dprintf(STDERR_FILENO, "|");
size_written += ft_dprintf(STDERR_FILENO, "%#llx", value);
}
return size_written;
return flags_log(value, flags, ELEM_COUNT(flags));
}

0 comments on commit 3967cb5

Please sign in to comment.