threads / patch / 22022

patchfprintf(stderr, "Warning...") -> warning("...")

Subject: [Squash PATCH] fprintf(stderr, "Warning...") -> warning("...")

## tl;dr

2 messages between Dec 24, 2009 and Dec 28, 2009. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Ilari Liusvaara· Dec 24, 2009, 10:41 UTC · lore
Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
---
 transport-helper.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

This fixes the small nit about fprintf(stderr, "Warning: ") by using warning() API.

It can be appiled on top of "Support remote helpers implementing smart transports" or squashed to it.

Show changes to transport-helper.c +3 −4
diff --git a/transport-helper.c b/transport-helper.c
index 55427df..8c8ca8e 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -420,11 +420,10 @@ static int process_connect_service(struct transport *transport,
 	if (strcmp(name, exec)) {
 		r = set_helper_option(transport, "servpath", exec);
 		if (r > 0)
-			fprintf(stderr, "Warning: Setting remote service path "
-				"not supported by protocol.\n");
+			warning("Setting remote service path not supported "
+				"by protocol.\n");
 		else if (r < 0)
-			fprintf(stderr, "Warning: Invalid remote service "
-				"path.\n");
+			warning("Invalid remote service path.\n");
 	}
 
 	if (data->connect)
-- 
1.6.6.3.gaa2e1
Junio C Hamano· Dec 28, 2009, 09:24 UTC · re: Ilari Liusvaara · lore

Re: [Squash PATCH] fprintf(stderr, "Warning...") -> warning("...")

Ilari Liusvaara <ilari.liusvaara@elisanet.fi> writes:
Show 10 quoted lines
> Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
> ---
>  transport-helper.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
>
> This fixes the small nit about fprintf(stderr, "Warning: ") by using
> warning() API. 
>
> It can be appiled on top of "Support remote helpers implementing smart
> transports" or squashed to it.
Thanks; will squash but with two minor touch-ups:
 - warning() adds its own terminating LF so we need to drop it from the caller;
 - being able to grep for an error/warning message is more important than
   keeping the source line strictly shorter than 80-columns.
Show 21 quoted lines
> diff --git a/transport-helper.c b/transport-helper.c
> index 55427df..8c8ca8e 100644
> --- a/transport-helper.c
> +++ b/transport-helper.c
> @@ -420,11 +420,10 @@ static int process_connect_service(struct transport *transport,
>  	if (strcmp(name, exec)) {
>  		r = set_helper_option(transport, "servpath", exec);
>  		if (r > 0)
> -			fprintf(stderr, "Warning: Setting remote service path "
> -				"not supported by protocol.\n");
> +			warning("Setting remote service path not supported "
> +				"by protocol.\n");
>  		else if (r < 0)
> -			fprintf(stderr, "Warning: Invalid remote service "
> -				"path.\n");
> +			warning("Invalid remote service path.\n");
>  	}
>  
>  	if (data->connect)
> -- 
> 1.6.6.3.gaa2e1

← back to recent threads