@@ -817,9 +817,8 @@ static void start_packfile(void)
817817 struct pack_header hdr ;
818818 int pack_fd ;
819819
820- snprintf (tmpfile , sizeof (tmpfile ),
821- "%s/pack/tmp_pack_XXXXXX" , get_object_directory ());
822- pack_fd = xmkstemp (tmpfile );
820+ pack_fd = odb_mkstemp (tmpfile , sizeof (tmpfile ),
821+ "pack/tmp_pack_XXXXXX" );
823822 p = xcalloc (1 , sizeof (* p ) + strlen (tmpfile ) + 2 );
824823 strcpy (p -> pack_name , tmpfile );
825824 p -> pack_fd = pack_fd ;
@@ -879,9 +878,8 @@ static char *create_index(void)
879878 c = next ;
880879 }
881880
882- snprintf (tmpfile , sizeof (tmpfile ),
883- "%s/pack/tmp_idx_XXXXXX" , get_object_directory ());
884- idx_fd = xmkstemp (tmpfile );
881+ idx_fd = odb_mkstemp (tmpfile , sizeof (tmpfile ),
882+ "pack/tmp_idx_XXXXXX" );
885883 f = sha1fd (idx_fd , tmpfile );
886884 sha1write (f , array , 256 * sizeof (int ));
887885 git_SHA1_Init (& ctx );
@@ -907,9 +905,7 @@ static char *keep_pack(char *curr_index_name)
907905 chmod (pack_data -> pack_name , 0444 );
908906 chmod (curr_index_name , 0444 );
909907
910- snprintf (name , sizeof (name ), "%s/pack/pack-%s.keep" ,
911- get_object_directory (), sha1_to_hex (pack_data -> sha1 ));
912- keep_fd = open (name , O_RDWR |O_CREAT |O_EXCL , 0600 );
908+ keep_fd = odb_pack_keep (name , sizeof (name ), pack_data -> sha1 );
913909 if (keep_fd < 0 )
914910 die ("cannot create keep file" );
915911 write_or_die (keep_fd , keep_msg , strlen (keep_msg ));
0 commit comments