summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a0c2089)
raw | patch | inline | side by side (parent: a0c2089)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Sat, 8 Jul 2006 08:56:28 +0000 (10:56 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 8 Jul 2006 10:28:19 +0000 (03:28 -0700) |
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff --git a/builtin-add.c b/builtin-add.c
index bfbbb1bf52e10667f94dd574ab32fe070c98c4cb..2d256981733345f4a430e11812b6851f0351aabd 100644 (file)
--- a/builtin-add.c
+++ b/builtin-add.c
if (active_cache_changed) {
if (write_cache(newfd, active_cache, active_nr) ||
- commit_lock_file(&lock_file))
+ close(newfd) || commit_lock_file(&lock_file))
die("Unable to write new index file");
}
diff --git a/builtin-apply.c b/builtin-apply.c
index e9ead002d38368f6de6ba75f25542fe61258cfb9..c3af48917c9a96ce86442bea737f4a81c7e0fb55 100644 (file)
--- a/builtin-apply.c
+++ b/builtin-apply.c
if (write_index) {
if (write_cache(newfd, active_cache, active_nr) ||
- commit_lock_file(&lock_file))
+ close(newfd) || commit_lock_file(&lock_file))
die("Unable to write new index file");
}
diff --git a/builtin-read-tree.c b/builtin-read-tree.c
index 9a2099d7307903d62c85f3483a22969ab5094c84..23a8d92a4b77e7436069c976bc5fa0ec162a9324 100644 (file)
--- a/builtin-read-tree.c
+++ b/builtin-read-tree.c
}
if (write_cache(newfd, active_cache, active_nr) ||
- commit_lock_file(&lock_file))
+ close(newfd) || commit_lock_file(&lock_file))
die("unable to write new index file");
return 0;
}
diff --git a/builtin-rm.c b/builtin-rm.c
index 4d56a1f07065e6e8ebaa95fdfe843cffb6283af3..875d8252fa72cf7adc1d6bb254ebc3a5995e49dd 100644 (file)
--- a/builtin-rm.c
+++ b/builtin-rm.c
if (active_cache_changed) {
if (write_cache(newfd, active_cache, active_nr) ||
- commit_lock_file(&lock_file))
+ close(newfd) || commit_lock_file(&lock_file))
die("Unable to write new index file");
}
diff --git a/builtin-update-index.c b/builtin-update-index.c
index ef50243452c2f27572c941a5db9365c785f1fbd5..1a4200d151dd8e876c6f84531422cae50b049aa3 100644 (file)
--- a/builtin-update-index.c
+++ b/builtin-update-index.c
finish:
if (active_cache_changed) {
if (write_cache(newfd, active_cache, active_nr) ||
- commit_lock_file(lock_file))
+ close(newfd) || commit_lock_file(lock_file))
die("Unable to write new index file");
}
diff --git a/builtin-write-tree.c b/builtin-write-tree.c
index 70e9b6fcc6d93e9b869a0a1eac144cbea3ecba3f..449a4d1b575b591aa07a40532649f9ea06eb6890 100644 (file)
--- a/builtin-write-tree.c
+++ b/builtin-write-tree.c
missing_ok, 0) < 0)
die("git-write-tree: error building trees");
if (0 <= newfd) {
- if (!write_cache(newfd, active_cache, active_nr))
+ if (!write_cache(newfd, active_cache, active_nr)
+ && !close(newfd))
commit_lock_file(lock_file);
}
/* Not being able to write is fine -- we are only interested
diff --git a/checkout-index.c b/checkout-index.c
index ea40bc29bed17fbd6e3326edaa6fb3c38b742de6..29279555086ce36cdf598e390898a46888543846 100644 (file)
--- a/checkout-index.c
+++ b/checkout-index.c
if (0 <= newfd &&
(write_cache(newfd, active_cache, active_nr) ||
- commit_lock_file(&lock_file)))
+ close(newfd) || commit_lock_file(&lock_file)))
die("Unable to write new index file");
return 0;
}