mksquashfs: Don't explicitly signal SIGUSR1 anymore

If the writer() thread hits an unrecoverable error then
exit via EXIT_MKSQUASHFS rather than explicitly raising
SIGUSR1, as EXIT_MKSQUASHFS now does the right thing (it
itself raises SIGUSR1 and kills the calling thread if apppending,
or just exits itself if not appending).

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
progressbar: Don't explicitly signal SIGUSR1 anymore

If the progressbar thread hits an unrecoverable error then
exit via BAD_ERROR rather than explicitly raising
SIGUSR1, as BAD_ERROR now does the right thing (it
itself raises SIGUSR1 and kills the calling thread if apppending,
or just exits itself if not appending).

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: add FATAL ERROR to error message

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: simplify pthread_cleanup_pop handling

If exiting via EXIT_MKSQUASHFS(), BAD_ERROR() or MEM_ERROR()
we do not need to explicitly execute the pthread_cleanup_pop
handler because these macros terminate the thread via
pthread_exit, which executes all pthread_cleanup handlers itself.
If we're not restoring, we simply exit the process, which is fine.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: fix recursive restore failure check

Fix recursive failure in restoring check by moving it to
prep_exit() and from restorefs(), this is because due to the
changes where all restoring is now done on the restore thread,
restorefs() is no longer recursively called, only prep_exit()
is now recursively called.

Whilst doing this, take advantage of the situation where restoring
is now only done on the restore thread to fix a theorectical
race condition with the previous code.  The previous code identified
recursive failure by incrementing the restoring flag every time it
was called, if the restore flag increased beyond one then we had
recursion, unfortunately this did not handle the case where two or more
threads simultaneously entered the restoring code but before restoring
took place, each thread would increment the flag making it look like
recursive restoring had taken place.  The new code fixes this by
checking if the restore thread has entered prep_exit(), if it has
then we have recursive failure.  This is a much more specific check
which allows multiple threads to fail and enter the restore code
simultaneously.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
info: add info.h

and move extern definitions to it.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: disable info printing once once file processing has stopped

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
restore: disable info printing when restoring

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: move the caches, queues and lists implementations

to a separate file, and out of mksquashfs.c.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>