Static build (scan only)

This commit is contained in:
2019-10-27 11:17:11 -04:00
parent 4109ba6d34
commit 9b7c56a608
15 changed files with 473 additions and 259 deletions

View File

@@ -115,8 +115,8 @@ void write_document(document_t *doc) {
if (IndexFd == -1) {
char dstfile[PATH_MAX];
pid_t tid = syscall(SYS_gettid);
snprintf(dstfile, PATH_MAX, "%s_index_%d", ScanCtx.index.path, tid);
pthread_t self = pthread_self();
snprintf(dstfile, PATH_MAX, "%s_index_%lu", ScanCtx.index.path, self);
IndexFd = open(dstfile, O_CREAT | O_WRONLY | O_APPEND, S_IRUSR | S_IWUSR);
if (IndexFd == -1) {