[PATCH] erofs-utils: Print program name and version to stdout

Gao Xiang hsiangkao at linux.alibaba.com
Wed Feb 9 12:48:20 AEDT 2022


On Tue, Feb 08, 2022 at 04:53:07PM -0800, Peter Collingbourne wrote:
> The program name and version is not an error message, so it should
> go to stdout, not stderr.
> 
> Signed-off-by: Peter Collingbourne <pcc at google.com>

Applied, thanks!

Thanks,
Gao Xiang

> ---
>  dump/main.c | 2 +-
>  fsck/main.c | 2 +-
>  fuse/main.c | 2 +-
>  mkfs/main.c | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/dump/main.c b/dump/main.c
> index b7560ec..ad1b62e 100644
> --- a/dump/main.c
> +++ b/dump/main.c
> @@ -109,7 +109,7 @@ static void usage(void)
>  
>  static void erofsdump_print_version(void)
>  {
> -	fprintf(stderr, "dump.erofs %s\n", cfg.c_version);
> +	printf("dump.erofs %s\n", cfg.c_version);
>  }
>  
>  static int erofsdump_parse_options_cfg(int argc, char **argv)
> diff --git a/fsck/main.c b/fsck/main.c
> index aefa881..2ebc5e9 100644
> --- a/fsck/main.c
> +++ b/fsck/main.c
> @@ -43,7 +43,7 @@ static void usage(void)
>  
>  static void erofsfsck_print_version(void)
>  {
> -	fprintf(stderr, "fsck.erofs %s\n", cfg.c_version);
> +	printf("fsck.erofs %s\n", cfg.c_version);
>  }
>  
>  static int erofsfsck_parse_options_cfg(int argc, char **argv)
> diff --git a/fuse/main.c b/fuse/main.c
> index 255965e..b7760e4 100644
> --- a/fuse/main.c
> +++ b/fuse/main.c
> @@ -210,7 +210,7 @@ int main(int argc, char *argv[])
>  	struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
>  
>  	erofs_init_configure();
> -	fprintf(stderr, "%s %s\n", basename(argv[0]), cfg.c_version);
> +	printf("%s %s\n", basename(argv[0]), cfg.c_version);
>  
>  #if defined(HAVE_EXECINFO_H) && defined(HAVE_BACKTRACE)
>  	if (signal(SIGSEGV, signal_handle_sigsegv) == SIG_ERR) {
> diff --git a/mkfs/main.c b/mkfs/main.c
> index 58a6441..4325ab4 100644
> --- a/mkfs/main.c
> +++ b/mkfs/main.c
> @@ -548,7 +548,7 @@ int parse_source_date_epoch(void)
>  void erofs_show_progs(int argc, char *argv[])
>  {
>  	if (cfg.c_dbg_lvl >= EROFS_WARN)
> -		fprintf(stderr, "%s %s\n", basename(argv[0]), cfg.c_version);
> +		printf("%s %s\n", basename(argv[0]), cfg.c_version);
>  }
>  
>  int main(int argc, char **argv)
> -- 
> 2.35.0.263.gb82422642f-goog


More information about the Linux-erofs mailing list