r912: very minor improvement
This commit is contained in:
parent
c280274331
commit
8af17b3478
8
bwashm.c
8
bwashm.c
|
|
@ -53,15 +53,15 @@ int bwa_shm_stage(bwaidx_t *idx, const char *hint, const char *_tmpfn)
|
||||||
}
|
}
|
||||||
|
|
||||||
strcat(strcpy(path, "/bwaidx-"), name);
|
strcat(strcpy(path, "/bwaidx-"), name);
|
||||||
l = 8 + strlen(name) + 1;
|
|
||||||
if (cnt[1] + l > BWA_CTL_SIZE) return -1;
|
|
||||||
memcpy(shm + cnt[1], &idx->l_mem, 8);
|
|
||||||
memcpy(shm + cnt[1] + 8, name, l - 8);
|
|
||||||
if ((shmid = shm_open(path, O_CREAT|O_RDWR|O_EXCL, 0644)) < 0) {
|
if ((shmid = shm_open(path, O_CREAT|O_RDWR|O_EXCL, 0644)) < 0) {
|
||||||
shm_unlink(path);
|
shm_unlink(path);
|
||||||
perror("shm_open()");
|
perror("shm_open()");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
l = 8 + strlen(name) + 1;
|
||||||
|
if (cnt[1] + l > BWA_CTL_SIZE) return -1;
|
||||||
|
memcpy(shm + cnt[1], &idx->l_mem, 8);
|
||||||
|
memcpy(shm + cnt[1] + 8, name, l - 8);
|
||||||
cnt[1] += l; ++cnt[0];
|
cnt[1] += l; ++cnt[0];
|
||||||
ftruncate(shmid, idx->l_mem);
|
ftruncate(shmid, idx->l_mem);
|
||||||
shm_idx = mmap(0, idx->l_mem, PROT_READ|PROT_WRITE, MAP_SHARED, shmid, 0);
|
shm_idx = mmap(0, idx->l_mem, PROT_READ|PROT_WRITE, MAP_SHARED, shmid, 0);
|
||||||
|
|
|
||||||
2
main.c
2
main.c
|
|
@ -4,7 +4,7 @@
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#ifndef PACKAGE_VERSION
|
#ifndef PACKAGE_VERSION
|
||||||
#define PACKAGE_VERSION "0.7.10-r911-dirty"
|
#define PACKAGE_VERSION "0.7.10-r912-dirty"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int bwa_fa2pac(int argc, char *argv[]);
|
int bwa_fa2pac(int argc, char *argv[]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue