X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fbuffer.c;h=a6daf3c9b3ae61774c52e09a61f913b211d09b9b;hb=f97d80335a1133d53901d3f80fa6edc2503c4b07;hp=81efe323eff270b531b486584ff12554068fe355;hpb=476019d08388d0db5c0cf1aeec5e8e32ebed073d;p=chaz%2Ftar diff --git a/src/buffer.c b/src/buffer.c index 81efe32..a6daf3c 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -20,11 +20,13 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include +#include #include #include #include +#include #include #include @@ -42,6 +44,7 @@ static tarlong prev_written; /* bytes written on previous volumes */ static tarlong bytes_written; /* bytes written on this volume */ static void *record_buffer[2]; /* allocated memory */ +union block *record_buffer_aligned[2]; static int record_index; /* FIXME: The following variables should ideally be static to this @@ -367,10 +370,11 @@ xclose (int fd) static void init_buffer () { - if (!record_buffer[record_index]) - page_aligned_alloc (&record_buffer[record_index], record_size); + if (! record_buffer_aligned[record_index]) + record_buffer_aligned[record_index] = + page_aligned_alloc (&record_buffer[record_index], record_size); - record_start = record_buffer[record_index]; + record_start = record_buffer_aligned[record_index]; current_block = record_start; record_end = record_start + blocking_factor; } @@ -967,7 +971,7 @@ new_volume (enum access_mode mode) static FILE *read_file; static int looped; int prompt; - + if (!read_file && !info_script_option) /* FIXME: if fopen is used, it will never be closed. */ read_file = archive == STDIN_FILENO ? fopen (TTY_NAME, "r") : stdin; @@ -991,7 +995,7 @@ new_volume (enum access_mode mode) looped = 1; } prompt = looped; - + tryagain: if (prompt) {