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:
commit
b1b065ee35
@ -188,9 +188,7 @@ static void init_thread(void)
|
||||
pthread_key_create(&key, NULL);
|
||||
CALLOC_ARRAY(thread_data, nr_threads);
|
||||
for (i = 0; i < nr_threads; i++) {
|
||||
thread_data[i].pack_fd = open(curr_pack, O_RDONLY);
|
||||
if (thread_data[i].pack_fd == -1)
|
||||
die_errno(_("unable to open %s"), curr_pack);
|
||||
thread_data[i].pack_fd = xopen(curr_pack, O_RDONLY);
|
||||
}
|
||||
|
||||
threads_active = 1;
|
||||
|
@ -2,15 +2,18 @@
|
||||
identifier fd;
|
||||
identifier die_fn =~ "^(die|die_errno)$";
|
||||
@@
|
||||
(
|
||||
fd =
|
||||
- open
|
||||
+ xopen
|
||||
(...);
|
||||
|
|
||||
int fd =
|
||||
- open
|
||||
+ 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(...); }
|
||||
|
Loading…
Reference in New Issue
Block a user