|
@@ -53,12 +53,6 @@ static unsigned long page_size;
|
|
static ssize_t calc_data_size;
|
|
static ssize_t calc_data_size;
|
|
static bool repipe;
|
|
static bool repipe;
|
|
|
|
|
|
-/* If it fails, the next read will report it */
|
|
|
|
-static void skip(int size)
|
|
|
|
-{
|
|
|
|
- lseek(input_fd, size, SEEK_CUR);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static int do_read(int fd, void *buf, int size)
|
|
static int do_read(int fd, void *buf, int size)
|
|
{
|
|
{
|
|
int rsize = size;
|
|
int rsize = size;
|
|
@@ -98,6 +92,19 @@ static int read_or_die(void *data, int size)
|
|
return r;
|
|
return r;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/* If it fails, the next read will report it */
|
|
|
|
+static void skip(int size)
|
|
|
|
+{
|
|
|
|
+ char buf[BUFSIZ];
|
|
|
|
+ int r;
|
|
|
|
+
|
|
|
|
+ while (size) {
|
|
|
|
+ r = size > BUFSIZ ? BUFSIZ : size;
|
|
|
|
+ read_or_die(buf, r);
|
|
|
|
+ size -= r;
|
|
|
|
+ };
|
|
|
|
+}
|
|
|
|
+
|
|
static unsigned int read4(void)
|
|
static unsigned int read4(void)
|
|
{
|
|
{
|
|
unsigned int data;
|
|
unsigned int data;
|