зеркало из https://github.com/microsoft/git.git
Merge branch 'rs/use-xopen-in-index-pack'
Code clean-up. * rs/use-xopen-in-index-pack: index-pack: use xopen in init_thread
This commit is contained in:
Коммит
b1b065ee35
|
@ -188,9 +188,7 @@ static void init_thread(void)
|
||||||
pthread_key_create(&key, NULL);
|
pthread_key_create(&key, NULL);
|
||||||
CALLOC_ARRAY(thread_data, nr_threads);
|
CALLOC_ARRAY(thread_data, nr_threads);
|
||||||
for (i = 0; i < nr_threads; i++) {
|
for (i = 0; i < nr_threads; i++) {
|
||||||
thread_data[i].pack_fd = open(curr_pack, O_RDONLY);
|
thread_data[i].pack_fd = xopen(curr_pack, O_RDONLY);
|
||||||
if (thread_data[i].pack_fd == -1)
|
|
||||||
die_errno(_("unable to open %s"), curr_pack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
threads_active = 1;
|
threads_active = 1;
|
||||||
|
|
|
@ -2,15 +2,18 @@
|
||||||
identifier fd;
|
identifier fd;
|
||||||
identifier die_fn =~ "^(die|die_errno)$";
|
identifier die_fn =~ "^(die|die_errno)$";
|
||||||
@@
|
@@
|
||||||
(
|
|
||||||
fd =
|
|
||||||
- open
|
|
||||||
+ xopen
|
|
||||||
(...);
|
|
||||||
|
|
|
||||||
int fd =
|
int fd =
|
||||||
- open
|
- open
|
||||||
+ xopen
|
+ xopen
|
||||||
(...);
|
(...);
|
||||||
)
|
- if ( \( fd < 0 \| fd == -1 \) ) { die_fn(...); }
|
||||||
|
|
||||||
|
@@
|
||||||
|
expression fd;
|
||||||
|
identifier die_fn =~ "^(die|die_errno)$";
|
||||||
|
@@
|
||||||
|
fd =
|
||||||
|
- open
|
||||||
|
+ xopen
|
||||||
|
(...);
|
||||||
- if ( \( fd < 0 \| fd == -1 \) ) { die_fn(...); }
|
- if ( \( fd < 0 \| fd == -1 \) ) { die_fn(...); }
|
||||||
|
|
Загрузка…
Ссылка в новой задаче