|
a/src/utils/circache.cpp |
|
b/src/utils/circache.cpp |
|
... |
|
... |
389 |
|
389 |
|
390 |
bool writeEntryHeader(off_t offset, const EntryHeaderData& d)
|
390 |
bool writeEntryHeader(off_t offset, const EntryHeaderData& d)
|
391 |
{
|
391 |
{
|
392 |
char bf[CIRCACHE_HEADER_SIZE];
|
392 |
char bf[CIRCACHE_HEADER_SIZE];
|
393 |
memset(bf, 0, CIRCACHE_HEADER_SIZE);
|
393 |
memset(bf, 0, CIRCACHE_HEADER_SIZE);
|
|
|
394 |
snprintf(bf, CIRCACHE_HEADER_SIZE,
|
394 |
sprintf(bf, headerformat, d.dicsize, d.datasize, d.padsize, d.flags);
|
395 |
headerformat, d.dicsize, d.datasize, d.padsize, d.flags);
|
395 |
if (lseek(m_fd, offset, 0) != offset) {
|
396 |
if (lseek(m_fd, offset, 0) != offset) {
|
396 |
m_reason << "CirCache::weh: lseek(" << offset <<
|
397 |
m_reason << "CirCache::weh: lseek(" << offset <<
|
397 |
") failed: errno " << errno;
|
398 |
") failed: errno " << errno;
|
398 |
return false;
|
399 |
return false;
|
399 |
}
|
400 |
}
|
|
... |
|
... |
998 |
return false;
|
999 |
return false;
|
999 |
}
|
1000 |
}
|
1000 |
|
1001 |
|
1001 |
char head[CIRCACHE_HEADER_SIZE];
|
1002 |
char head[CIRCACHE_HEADER_SIZE];
|
1002 |
memset(head, 0, CIRCACHE_HEADER_SIZE);
|
1003 |
memset(head, 0, CIRCACHE_HEADER_SIZE);
|
|
|
1004 |
snprintf(head, CIRCACHE_HEADER_SIZE,
|
1003 |
sprintf(head, headerformat, dic.size(), datalen, npadsize, flags);
|
1005 |
headerformat, dic.size(), datalen, npadsize, flags);
|
1004 |
struct iovec vecs[3];
|
1006 |
struct iovec vecs[3];
|
1005 |
vecs[0].iov_base = head;
|
1007 |
vecs[0].iov_base = head;
|
1006 |
vecs[0].iov_len = CIRCACHE_HEADER_SIZE;
|
1008 |
vecs[0].iov_len = CIRCACHE_HEADER_SIZE;
|
1007 |
vecs[1].iov_base = (void *)dic.c_str();
|
1009 |
vecs[1].iov_base = (void *)dic.c_str();
|
1008 |
vecs[1].iov_len = dic.size();
|
1010 |
vecs[1].iov_len = dic.size();
|