*/
/*
- * Copyright (C) 2012 Eric Biggers
+ * Copyright (C) 2012, 2013 Eric Biggers
*
* This file is part of wimlib, a library for working with WIM files.
*
for (size_t j = 0; j < MAX_CHUNKS_PER_MSG; j++) {
msgs[i].compressed_chunks[j] = MALLOC(WIM_CHUNK_SIZE);
- // The extra 8 bytes is because longest_match() in lz.c
- // may read a little bit off the end of the uncompressed
- // data. It doesn't need to be initialized--- we really
- // just need to avoid accessing an unmapped page.
+ // The extra 8 bytes is because longest_match() in
+ // lz77.c may read a little bit off the end of the
+ // uncompressed data. It doesn't need to be
+ // initialized--- we really just need to avoid accessing
+ // an unmapped page.
msgs[i].uncompressed_chunks[j] = MALLOC(WIM_CHUNK_SIZE + 8);
if (msgs[i].compressed_chunks[j] == NULL ||
msgs[i].uncompressed_chunks[j] == NULL)
for (unsigned i = 0; i < num_threads; i++) {
if (pthread_join(compressor_threads[i], NULL)) {
- WARNING("Failed to join compressor thread %u: %s",
- i, strerror(errno));
+ WARNING_WITH_ERRNO("Failed to join compressor "
+ "thread %u", i);
}
}
FREE(compressor_threads);
lte->wim == args->wim &&
lte->resource_entry.offset + lte->resource_entry.size > args->end_offset)
{
+ #ifdef ENABLE_ERROR_MESSAGES
ERROR("The following resource is after the XML data:");
- print_lookup_table_entry(lte);
+ print_lookup_table_entry(lte, stderr);
+ #endif
return WIMLIB_ERR_RESOURCE_ORDER;
}
" by another process!", w->filename);
ret = WIMLIB_ERR_ALREADY_LOCKED;
} else {
- WARNING("Failed to lock `%s': %s",
- w->filename, strerror(errno));
+ WARNING_WITH_ERRNO("Failed to lock `%s'",
+ w->filename);
ret = 0;
}
} else {
{
if (w->out_fp) {
if (fclose(w->out_fp) != 0) {
- WARNING("Failed to close output WIM: %s",
- strerror(errno));
+ WARNING_WITH_ERRNO("Failed to close output WIM");
}
w->out_fp = NULL;
}
w->fp = fopen(w->filename, "rb");
if (w->fp == NULL) {
ret = WIMLIB_ERR_REOPEN;
- WARNING("Failed to re-open `%s' read-only: %s",
- w->filename, strerror(errno));
+ WARNING_WITH_ERRNO("Failed to re-open `%s' read-only",
+ w->filename);
FREE(w->filename);
w->filename = NULL;
}
err:
/* Remove temporary file. */
if (unlink(tmpfile) != 0)
- WARNING("Failed to remove `%s': %s", tmpfile, strerror(errno));
+ WARNING_WITH_ERRNO("Failed to remove `%s'", tmpfile);
return ret;
}