read_xattrs: save_xattr_block() no longer returns failure

    Use MEM_ERROR() for malloc failure.

    Now MEM_ERROR deals with out of memory, save_xattr_block()
    no longer needs to return failure.  Remove failure return
    and checks for failure.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
read_xattrs: Use MEM_ERROR() in read_xattr_entry()

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
read_xattrs: Use MEM_ERROR() in read_xattrs_from_disk()

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
read_xattrs: Use MEM_ERROR() in get_xattrs()

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: get rid of update_progress_bar()

Don't display the progress bar every time a file is written
as the background 1/4 second display is sufficient.

Removing this eliminates an unanticipated main thread dependency
on the progress bar thread.  By grabbing the progress_mutex mutex
before doing the pthread_cond_signal() to wake up the progress bar
thread it means the main thread waits on the progress_mutex mutex
if the progress bar thread already has it grabbed.  Normally
when the progress bar wakes up it grabs the progress_mutex mutex
prints the progress bar and quickly releases the mutex, and so
the main thread will never wait on the mutex.  However, if
the progress bar printing is slow, the main thread can wake up
the progress bar thread when a file is written, and it can
still be printing the progress bar when the main thread writes
the next file, causing the main thread to wait.

In effect this throttles file writing to the speed of the progress
bar printing, normally this has no effect because progress bar
printing is faster, however, if the output terminal is running
over a slow link this can become a bottleneck.  The author
has noticed this running Mksquashfs on a VT102 connected via a
9600 baud serial line.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
progress_bar: get rid of progress_wait and pthread_cond_timedwait()

Now that we don't wake up the progress bar thread get rid
of the progress_wait variable and the pthread_cond_timewait()
call and instead replace it with a call to nanosleep().

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: tidy up signal handling and document the signal usage

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: print file being squashed when ^\ (SIGQUIT) typed

If ^\ is typed on the keyboard whilst Mksquashfs is squashing files
(progress bar being printed), then display the filename of the
file being squashed.

The progress bar is useful to display how far blockwise/percentage-wise
Mksquashfs has got, but, it doesn't display filenames, and it is
often nice to get a snapshot filewise where Mksquashfs has got to.
Obviously, you can use -info for this, but this is a "heavy-weight"
option which displays every filename, it not only leads to
screenfulls of text, but it also can slow Mksquashfs down as it
is bottlenecked by all the filename printing.

Adding the ^\ option offers a best of both worlds, Mksquashfs
displays the progress bar which gives nice feedback on the
progress of Mksquashfs but in a way which does not generate
lots of text and doesn't slow Mksquashfs down, and typing ^\
gives you the filename of file being squashed but only when
desired, which doesn't generate screenfulls of text or slow
Mksquashfs down.

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