aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-08-27 16:23:54 -0700
committerJunio C Hamano <gitster@pobox.com>2008-08-27 16:23:54 -0700
commitbb34ca5c5f7df33ea84a5b71621dbdeac1da39c1 (patch)
treeb098a3292b4c32dae69cf6385d7faa0a33d47d14
parentcdc7e388da47b66fe11c92ed7698ec233ce70635 (diff)
parentc67b1fa349cc7b4341b32b9ef1c58a3821ce0830 (diff)
downloadgit-bb34ca5c5f7df33ea84a5b71621dbdeac1da39c1.tar.gz
git-bb34ca5c5f7df33ea84a5b71621dbdeac1da39c1.tar.xz
Merge branch 'maint'
* maint: ctype.c: protect tiny C preprocessor constants index-pack: be careful after fixing up the header/footer
-rw-r--r--builtin-pack-objects.c1
-rw-r--r--ctype.c5
-rw-r--r--pack-write.c1
3 files changed, 6 insertions, 1 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 2dadec163..d394c494a 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -499,7 +499,6 @@ static void write_pack_file(void)
} else {
int fd = sha1close(f, NULL, 0);
fixup_pack_header_footer(fd, sha1, pack_tmp_name, nr_written);
- fsync_or_die(fd, pack_tmp_name);
close(fd);
}
diff --git a/ctype.c b/ctype.c
index ee06eb7f4..d2bd38e90 100644
--- a/ctype.c
+++ b/ctype.c
@@ -5,6 +5,11 @@
*/
#include "cache.h"
+/* Just so that no insane platform contaminate namespace with these symbols */
+#undef SS
+#undef AA
+#undef DD
+
#define SS GIT_SPACE
#define AA GIT_ALPHA
#define DD GIT_DIGIT
diff --git a/pack-write.c b/pack-write.c
index a8f026993..ddcfd37af 100644
--- a/pack-write.c
+++ b/pack-write.c
@@ -179,6 +179,7 @@ void fixup_pack_header_footer(int pack_fd,
SHA1_Final(pack_file_sha1, &c);
write_or_die(pack_fd, pack_file_sha1, 20);
+ fsync_or_die(pack_fd, pack_name);
}
char *index_pack_lockfile(int ip_out)