mirror of
https://github.com/nilfs-dev/nilfs-utils.git
synced 2026-01-26 13:43:15 +00:00
{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:
parent
1a54af4e7d
commit
783fe0a7ea
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user