Fix missed archive entry record.

Fix enabling of metadata stream feature.
Fix log message text.
Use macro for path separator.
This commit is contained in:
Moinak Ghosh 2014-12-11 23:16:26 +05:30
parent f970b41e34
commit dfe18ef48f
3 changed files with 14 additions and 9 deletions

View file

@ -362,7 +362,7 @@ archiver_write(void *ctx, void *buf, uint64_t count)
}
if (pctx->arc_buf != NULL) {
log_msg(LOG_ERR, 0, "Incorrect sequencing of archiver_read() call.");
log_msg(LOG_ERR, 0, "Incorrect sequencing of archiver_write() call.");
return (-1);
}
@ -661,7 +661,7 @@ add_pathname(const char *fpath, const struct stat *sb,
/*
* Sort Buffer is full so sort it. Sorting is done by file extension and size.
* If file has no extension then first 4 chars of the filename are used.
* If file has no extension then an algorithm is used, described below.
*/
srt = (struct sort_buf *)malloc(sizeof (struct sort_buf));
if (srt == NULL) {
@ -742,7 +742,7 @@ add_pathname(const char *fpath, const struct stat *sb,
*/
nsep = 0;
for (i = 0; i < plen; i++) {
if (fpath[i] == '/') {
if (fpath[i] == PATHSEP_CHAR) {
nsep++;
}
}

View file

@ -245,6 +245,7 @@ metadata_compress(void *dat)
* compress and write the buffer.
*/
memcpy(mctx->frombuf + mctx->frompos, msgp->buf, msgp->len);
mctx->frompos += msgp->len;
if (!compress_and_write(mctx)) {
Write(mctx->meta_pipes[SINK_CHANNEL], &ack, sizeof (ack));
return (NULL);

View file

@ -3590,6 +3590,16 @@ init_pc_context(pc_ctx_t *pctx, int argc, char *argv[])
}
}
if (pctx->archive_mode) {
if (pctx->meta_stream != -1)
pctx->meta_stream = 1;
else
pctx->meta_stream = 0;
}
if (pctx->pipe_mode)
pctx->meta_stream = 0;
/*
* Auto-select filters and preprocessing modes based on compresion level.
* This is not done if user explicitly specified advanced options.
@ -3607,12 +3617,6 @@ init_pc_context(pc_ctx_t *pctx, int argc, char *argv[])
pctx->enable_packjpg = ff.enable_packjpg;
pctx->enable_wavpack = ff.enable_wavpack;
if (pctx->level > 8) pctx->exe_preprocess = 1;
if (pctx->meta_stream != -1)
pctx->meta_stream = 1;
else
pctx->meta_stream = 0;
if (pctx->pipe_mode)
pctx->meta_stream = 0;
}
/*