summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 40d6dc0)
raw | patch | inline | side by side (parent: 40d6dc0)
author | Junio C Hamano <junkio@cox.net> | |
Sat, 27 Jan 2007 01:00:57 +0000 (17:00 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 27 Jan 2007 01:00:57 +0000 (17:00 -0800) |
Signed-off-by: Junio C Hamano <junkio@cox.net>
refs.c | patch | blob | history |
index 0840b3bab8b404f9480df89447a497963b7117fb..12e46b8bbefb35e5d402b3c8ef20dd9e4263e81a 100644 (file)
--- a/refs.c
+++ b/refs.c
return -1;
}
lockpath = mkpath("%s.lock", git_HEAD);
- fd = open(lockpath, O_CREAT | O_EXCL | O_WRONLY, 0666);
+ fd = open(lockpath, O_CREAT | O_EXCL | O_WRONLY, 0666);
+ if (fd < 0) {
+ error("Unable to open %s for writing", lockpath);
+ return -5;
+ }
written = write_in_full(fd, ref, len);
close(fd);
if (written != len) {