{mount,umount}.nilfs2: use vwarnx() in logging callbacks

Simplify the logging callback functions nilfs_mount_logger() and
nilfs_umount_logger() by using vwarnx().

This replaces the manual fprintf() sequence with the standard <err.h>
function, ensuring consistent message formatting (including the program
name prefix) across the utilities.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
This commit is contained in:
Ryusuke Konishi 2026-01-19 15:55:05 +09:00
parent 1a54af4e7d
commit 783fe0a7ea
2 changed files with 2 additions and 6 deletions

View File

@ -125,9 +125,7 @@ static void nilfs_mount_logger(int priority, const char *fmt, ...)
if ((verbose && priority > LOG_INFO) || priority >= LOG_INFO)
return;
va_start(args, fmt);
fprintf(stderr, "%s: ", progname);
vfprintf(stderr, fmt, args);
fputs(_("\n"), stderr);
vwarnx(fmt, args);
va_end(args);
}

View File

@ -105,9 +105,7 @@ static void nilfs_umount_logger(int priority, const char *fmt, ...)
if ((verbose && priority > LOG_INFO) || priority >= LOG_INFO)
return;
va_start(args, fmt);
fprintf(stderr, "%s: ", progname);
vfprintf(stderr, fmt, args);
fputs(_("\n"), stderr);
vwarnx(fmt, args);
va_end(args);
}