Re: [PATCH v8 33/41] write_or_die: use warning() instead of fprintf(stderr, ...)
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 28, 2016, 21:39 UTC
- Message-ID
- <xmqqoa6l6lia.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20160627182429.31550-34-chriscool@tuxfamily.org>
Christian Couder <christian.couder@gmail.com> writes:
Show 23 quoted lines
> diff --git a/write_or_die.c b/write_or_die.c
> index 49e80aa..c29f677 100644
> --- a/write_or_die.c
> +++ b/write_or_die.c
> @@ -87,8 +87,7 @@ int write_or_whine_pipe(int fd, const void *buf, size_t count, const char *msg)
> {
> if (write_in_full(fd, buf, count) < 0) {
> check_pipe(errno);
> - fprintf(stderr, "%s: write error (%s)\n",
> - msg, strerror(errno));
> + warning("%s: write error (%s)\n", msg, strerror(errno));
> return 0;
> }
>
> @@ -98,8 +97,7 @@ int write_or_whine_pipe(int fd, const void *buf, size_t count, const char *msg)
> int write_or_whine(int fd, const void *buf, size_t count, const char *msg)
> {
> if (write_in_full(fd, buf, count) < 0) {
> - fprintf(stderr, "%s: write error (%s)\n",
> - msg, strerror(errno));
> + warning("%s: write error (%s)\n", msg, strerror(errno));
> return 0;
> }I do not think you call write_or_whine() at all. As another topic in flight removes the last caller of this function, this hunk is very much unwelcome. The only effect of it is to force me resolve unnecessary merge conflicts.