5 Dec 01:34
[PATCH 1/3] Make some of fwrite/fclose/write/close failures visible
From: Alex Riesen <raa.lkml <at> gmail.com>
Subject: [PATCH 1/3] Make some of fwrite/fclose/write/close failures visible
Newsgroups: gmane.comp.version-control.git
Date: 2008-12-05 00:35:48 GMT
Subject: [PATCH 1/3] Make some of fwrite/fclose/write/close failures visible
Newsgroups: gmane.comp.version-control.git
Date: 2008-12-05 00:35:48 GMT
So that full filesystem conditions or permissions problems wont go unnoticed. Signed-off-by: Alex Riesen <raa.lkml <at> gmail.com> --- This and the follow-up patches is fallout of Windows debugging sessions. I implemented random error handling code just to figure out where it might be going wrong. None of that code actually helped to fix something (and lots was just thrown away), but some, I think, still makes sense. This patch adds error handling only to fwrite/fputs where the return value was ignored and writing was definitely into a file. BTW, libc headers in Ubuntu 8.10 have warn_unused_result attribute added to many functions (fwrite(3) and write(2) amongst them). This helps finding the problem places. builtin-fsck.c | 8 ++++++-- builtin-merge.c | 6 ++++-- rerere.c | 46 +++++++++++++++++++++++++++++++++++----------- 3 files changed, 45 insertions(+), 15 deletions(-) diff --git a/builtin-fsck.c b/builtin-fsck.c index d3f3de9..afded5e 100644 --- a/builtin-fsck.c +++ b/builtin-fsck.c @@ -201,12 +201,16 @@ static void check_unreachable_object(struct object *obj) char *buf = read_sha1_file(obj->sha1, &type, &size);(Continue reading)
RSS Feed