X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=index-pack.c;h=db58e050410197f6eda4b91705e20a8bfc87b088;hb=08fbb136f7440eac96f4e4396316aff36526f299;hp=82c8da3683bbda15a5f7476d93c14737617d3e49;hpb=c85d4f166096225fa78a9aec8707c6b834da74cb;p=git.git diff --git a/index-pack.c b/index-pack.c index 82c8da368..db58e0504 100644 --- a/index-pack.c +++ b/index-pack.c @@ -114,7 +114,7 @@ static const char *open_pack_file(const char *pack_name) static char tmpfile[PATH_MAX]; snprintf(tmpfile, sizeof(tmpfile), "%s/tmp_pack_XXXXXX", get_object_directory()); - output_fd = mkstemp(tmpfile); + output_fd = xmkstemp(tmpfile); pack_name = xstrdup(tmpfile); } else output_fd = open(pack_name, O_CREAT|O_EXCL|O_RDWR, 0600); @@ -634,7 +634,8 @@ static void final(const char *final_pack_name, const char *curr_pack_name, write_or_die(keep_fd, keep_msg, keep_msg_len); write_or_die(keep_fd, "\n", 1); } - close(keep_fd); + if (close(keep_fd) != 0) + die("cannot write keep file"); report = "keep"; } }