Handle fopen() errors
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest15 patches 14 repliesIn review
Patches in v1 No applies recorded yet
Reviews trailers per patch
None of the 15 patches has a Reviewed-by or Acked-by.
| Patch | Jeff King |
|---|---|
| Series | Noticed-by |
| 1/15 | |
| 2/15 | |
| 3/15 | |
| 4/15 | |
| 5/15 | |
| 6/15 | |
| 7/15 | |
| 8/15 | |
| 9/15 | |
| 10/15 | |
| 11/15 | |
| 12/15 | |
| 13/15 | |
| 14/15 | |
| 15/15 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/15] Handle fopen() errors
Some of you may recall a while back, nd/conditional-config-include failed on Windows because I accidentally fopen()'d a directory in a test, but it's not considered an serious error unless it's on Windows, where fopen(<dir>) returns NULL.
A couple of suggestions were thrown back and forth, but I was a bit busy to follow up. Now that I have time, I have audited all fopen() calls and try to fix them up for good. There 15 patches, but they only change one or two lines each. I split them anyway so you can pause between patches and see if it really makes sense, as changes are all over the places.
There are still a few iffy fopen() calls in sequencer.c though. I only fixed the easy ones in there.
The last patch may fail on some platforms since I want to make sure that fopen(<directory>) == NULL is an expected behavior, even though I could only test FreeBSD and Linux (and know Windows behaves the same). At least when people shout up, we could start adding FREAD_READS_DIRECTORIES on those platforms. That's the goal.
Nguyễn Thái Ngọc Duy (15):
config.mak.uname: set FREAD_READS_DIRECTORIES for Linux and FreeBSD
bisect: report on fopen() error
blame: report error on open if graft_file is a directory
clone: use xfopen() instead of fopen()
log: report errno on failure to fopen() a file
commit.c: report error on failure to fopen() the graft file remote.c: report error on failure to fopen()
rerere.c: report error on failure to fopen()
rerere.c: report correct errno
sequencer.c: report error on failure to fopen()
server-info: report error on failure to fopen() wt-status.c: report error on failure to fopen() xdiff-interface.c: report errno on failure to stat() or fopen() config.c: handle error on failing to fopen()
t1308: add a test case on open a config directory
bisect.c | 5 ++++- builtin/blame.c | 5 ++++- builtin/clone.c | 2 +- builtin/log.c | 3 ++- commit.c | 5 ++++- config.c | 8 +++++++- config.mak.uname | 3 +++ remote.c | 12 ++++++++++-- rerere.c | 10 +++++++--- sequencer.c | 5 ++++- server-info.c | 5 ++++- t/t1308-config-set.sh | 13 ++++++++++++- wt-status.c | 2 ++ xdiff-interface.c | 4 ++-- 14 files changed, 66 insertions(+), 16 deletions(-)
Signature · 1 line
2.11.0.157.gd943d85