All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] write_or_die: remove the unused write_or_whine() function
@ 2016-06-09 22:52 Ramsay Jones
  2016-06-10  0:01 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Ramsay Jones @ 2016-06-09 22:52 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, GIT Mailing-list


Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---

Hi Junio,

Commit f0bca72d ("send-pack: use buffered I/O to talk to pack-objects",
08-06-2016) removed the last use of write_or_whine(). I had intended to
include this 'commit citation' in the commit message, but until it reaches
the next branch, I don't know how stable that information will be.

Anyway, on reflection, the subject line says everything that needs to be
said. However, you need to know which commit this one depends on. ;-)

ATB,
Ramsay Jones

 cache.h        |  1 -
 write_or_die.c | 11 -----------
 2 files changed, 12 deletions(-)

diff --git a/cache.h b/cache.h
index 84d8812..258f154 100644
--- a/cache.h
+++ b/cache.h
@@ -1767,7 +1767,6 @@ extern int copy_file(const char *dst, const char *src, int mode);
 extern int copy_file_with_time(const char *dst, const char *src, int mode);
 
 extern void write_or_die(int fd, const void *buf, size_t count);
-extern int write_or_whine(int fd, const void *buf, size_t count, const char *msg);
 extern int write_or_whine_pipe(int fd, const void *buf, size_t count, const char *msg);
 extern void fsync_or_die(int fd, const char *);
 
diff --git a/write_or_die.c b/write_or_die.c
index 49e80aa..9816879 100644
--- a/write_or_die.c
+++ b/write_or_die.c
@@ -94,14 +94,3 @@ int write_or_whine_pipe(int fd, const void *buf, size_t count, const char *msg)
 
 	return 1;
 }
-
-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));
-		return 0;
-	}
-
-	return 1;
-}
-- 
2.8.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] write_or_die: remove the unused write_or_whine() function
  2016-06-09 22:52 [PATCH] write_or_die: remove the unused write_or_whine() function Ramsay Jones
@ 2016-06-10  0:01 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2016-06-10  0:01 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: Junio C Hamano, GIT Mailing-list

On Thu, Jun 09, 2016 at 11:52:22PM +0100, Ramsay Jones wrote:

> 
> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
> ---
> 
> Hi Junio,
> 
> Commit f0bca72d ("send-pack: use buffered I/O to talk to pack-objects",
> 08-06-2016) removed the last use of write_or_whine(). I had intended to
> include this 'commit citation' in the commit message, but until it reaches
> the next branch, I don't know how stable that information will be.
> 
> Anyway, on reflection, the subject line says everything that needs to be
> said. However, you need to know which commit this one depends on. ;-)

IMHO, it's a good idea for removal patches to reflect on why the thing
is appropriate to remove. Obviously there are no callers, but do we
expect any to come back? I think probably not, because this function is
doing very little that a regular if() does not besides obfuscating the
error message (and if we ever did want something like it, we would
probably prefer the function to come back with more "normal" return
value semantics).

-Peff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-10  0:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-09 22:52 [PATCH] write_or_die: remove the unused write_or_whine() function Ramsay Jones
2016-06-10  0:01 ` Jeff King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.