static unsigned long page_size;
static ssize_t calc_data_size;
+static bool repipe;
/* If it fails, the next read will report it */
static void skip(int size)
if (ret <= 0)
return -1;
+ if (repipe) {
+ int retw = write(STDOUT_FILENO, buf, ret);
+
+ if (retw <= 0 || retw != ret)
+ die("repiping input file");
+ }
+
size -= ret;
buf += ret;
}
if (!r)
die("no data");
+ if (repipe) {
+ int retw = write(STDOUT_FILENO, &c, 1);
+
+ if (retw <= 0 || retw != r)
+ die("repiping input file string");
+ }
+
buf[size++] = c;
if (!c)
return data;
}
-ssize_t trace_report(int fd)
+ssize_t trace_report(int fd, bool __repipe)
{
char buf[BUFSIZ];
char test[] = { 23, 8, 68 };
ssize_t size;
calc_data_size = 1;
+ repipe = __repipe;
input_fd = fd;
size = calc_data_size - 1;
calc_data_size = 0;
+ repipe = false;
if (show_funcs) {
print_funcs();