@@ -445,21 +445,21 @@ FILE *fopen_or_warn(const char *path, const char *mode)
445
445
return NULL ;
446
446
}
447
447
448
- int xmkstemp (char * template )
448
+ int xmkstemp (char * filename_template )
449
449
{
450
450
int fd ;
451
451
char origtemplate [PATH_MAX ];
452
- strlcpy (origtemplate , template , sizeof (origtemplate ));
452
+ strlcpy (origtemplate , filename_template , sizeof (origtemplate ));
453
453
454
- fd = mkstemp (template );
454
+ fd = mkstemp (filename_template );
455
455
if (fd < 0 ) {
456
456
int saved_errno = errno ;
457
457
const char * nonrelative_template ;
458
458
459
- if (strlen (template ) != strlen (origtemplate ))
460
- template = origtemplate ;
459
+ if (strlen (filename_template ) != strlen (origtemplate ))
460
+ filename_template = origtemplate ;
461
461
462
- nonrelative_template = absolute_path (template );
462
+ nonrelative_template = absolute_path (filename_template );
463
463
errno = saved_errno ;
464
464
die_errno ("Unable to create temporary file '%s'" ,
465
465
nonrelative_template );
@@ -481,7 +481,7 @@ int git_mkstemps_mode(char *pattern, int suffix_len, int mode)
481
481
static const int num_letters = 62 ;
482
482
uint64_t value ;
483
483
struct timeval tv ;
484
- char * template ;
484
+ char * filename_template ;
485
485
size_t len ;
486
486
int fd , count ;
487
487
@@ -503,16 +503,16 @@ int git_mkstemps_mode(char *pattern, int suffix_len, int mode)
503
503
*/
504
504
gettimeofday (& tv , NULL );
505
505
value = ((size_t )(tv .tv_usec << 16 )) ^ tv .tv_sec ^ getpid ();
506
- template = & pattern [len - 6 - suffix_len ];
506
+ filename_template = & pattern [len - 6 - suffix_len ];
507
507
for (count = 0 ; count < TMP_MAX ; ++ count ) {
508
508
uint64_t v = value ;
509
509
/* Fill in the random bits. */
510
- template [0 ] = letters [v % num_letters ]; v /= num_letters ;
511
- template [1 ] = letters [v % num_letters ]; v /= num_letters ;
512
- template [2 ] = letters [v % num_letters ]; v /= num_letters ;
513
- template [3 ] = letters [v % num_letters ]; v /= num_letters ;
514
- template [4 ] = letters [v % num_letters ]; v /= num_letters ;
515
- template [5 ] = letters [v % num_letters ]; v /= num_letters ;
510
+ filename_template [0 ] = letters [v % num_letters ]; v /= num_letters ;
511
+ filename_template [1 ] = letters [v % num_letters ]; v /= num_letters ;
512
+ filename_template [2 ] = letters [v % num_letters ]; v /= num_letters ;
513
+ filename_template [3 ] = letters [v % num_letters ]; v /= num_letters ;
514
+ filename_template [4 ] = letters [v % num_letters ]; v /= num_letters ;
515
+ filename_template [5 ] = letters [v % num_letters ]; v /= num_letters ;
516
516
517
517
fd = open (pattern , O_CREAT | O_EXCL | O_RDWR , mode );
518
518
if (fd >= 0 )
@@ -541,21 +541,21 @@ int git_mkstemp_mode(char *pattern, int mode)
541
541
return git_mkstemps_mode (pattern , 0 , mode );
542
542
}
543
543
544
- int xmkstemp_mode (char * template , int mode )
544
+ int xmkstemp_mode (char * filename_template , int mode )
545
545
{
546
546
int fd ;
547
547
char origtemplate [PATH_MAX ];
548
- strlcpy (origtemplate , template , sizeof (origtemplate ));
548
+ strlcpy (origtemplate , filename_template , sizeof (origtemplate ));
549
549
550
- fd = git_mkstemp_mode (template , mode );
550
+ fd = git_mkstemp_mode (filename_template , mode );
551
551
if (fd < 0 ) {
552
552
int saved_errno = errno ;
553
553
const char * nonrelative_template ;
554
554
555
- if (!template [0 ])
556
- template = origtemplate ;
555
+ if (!filename_template [0 ])
556
+ filename_template = origtemplate ;
557
557
558
- nonrelative_template = absolute_path (template );
558
+ nonrelative_template = absolute_path (filename_template );
559
559
errno = saved_errno ;
560
560
die_errno ("Unable to create temporary file '%s'" ,
561
561
nonrelative_template );
0 commit comments