]> git.ipfire.org Git - thirdparty/git.git/commitdiff
write_or_die: remove the unused write_or_whine() function
authorRamsay Jones <ramsay@ramsayjones.plus.com>
Thu, 9 Jun 2016 22:52:22 +0000 (23:52 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Jun 2016 17:54:27 +0000 (10:54 -0700)
Now the last caller of this function is gone, and new ones are
unlikely to appear, 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).

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
write_or_die.c

diff --git a/cache.h b/cache.h
index 4ff196c25926cb1a6662f7582969ed665bae5ee3..5e5c1df1a7e7a7497ec462d6a568ed670e763e4c 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -1715,7 +1715,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 *);
 
index 49e80aa222132c3c151b79bd37749d92a12f745a..981687945a761a67f11f651eef78c49621df2d59 100644 (file)
@@ -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;
-}