diff options
author | Rene Scharfe <rene.scharfe@lsrfire.ath.cx> | 2006-08-21 22:43:43 +0400 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-08-22 07:22:23 +0400 |
commit | 7230e6d042ae385377f09c4d226d9b1aa7a2c13b (patch) | |
tree | 15c64d30f517ba50cac77f81efddc71d22666023 /Makefile | |
parent | 3f0073a2fabce18303aeef154dd6ec5aa8faa5e7 (diff) |
Add write_or_die(), a helper function
The little helper write_or_die() won't come back with bad news about
full disks or broken pipes. It either succeeds or terminates the
program, making additional error handling unnecessary.
This patch adds the new function and uses it to replace two similar
ones (the one in tar-tree originally has been copied from cat-file
btw.). I chose to add the fd parameter which both lacked to make
write_or_die() just as flexible as write() and thus suitable for
lib-ification.
There is a regression: error messages emitted by this function don't
show the program name, while the replaced two functions did. That's
acceptable, I think; a lot of other functions do the same.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -248,6 +248,7 @@ LIB_OBJS = \ server-info.o setup.o sha1_file.o sha1_name.o strbuf.o \ tag.o tree.o usage.o config.o environment.o ctype.o copy.o \ fetch-clone.o revision.o pager.o tree-walk.o xdiff-interface.o \ + write_or_die.o \ alloc.o merge-file.o path-list.o help.o unpack-trees.o $(DIFF_OBJS) BUILTIN_OBJS = \ |