Skip to content

Commit

Permalink
[utils] Use va_args in open_nomap_nolog to match wrappers
Browse files Browse the repository at this point in the history
Resolves error when using a compiler with stricter settings such as
when using LTO.

Signed-off-by: Björn Bidar <[email protected]>
  • Loading branch information
Thaodan committed Apr 26, 2024
1 parent 5d295db commit c1b6d26
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions utils/sb2-ruletree.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,18 @@ void sblog_printf_line_to_logfile(const char *file, int line,
va_end(ap);
}

extern int open_nomap_nolog(const char *pathname, int flags, mode_t mode);
extern int open_nomap_nolog(const char *pathname, int flags, ...);

int open_nomap_nolog(const char *pathname, int flags, mode_t mode)
int open_nomap_nolog(const char *pathname, int flags, ...)
{
mode_t mode = 0;
if(__OPEN_NEEDS_MODE(flags)) {
va_list arg;
va_start (arg, flags);
mode = va_arg (arg, int);
va_end (arg);
}

return open(pathname, flags, mode);
}

Expand Down

0 comments on commit c1b6d26

Please sign in to comment.