ar_io.c (2749b1412921cacde0110606121acb7a5e1e2b62) ar_io.c (5b94264c208e2eee704ce67146e52c271dc4ef6f)
1/*-
2 * Copyright (c) 1992 Keith Muller.
3 * Copyright (c) 1992, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Keith Muller of the University of California, San Diego.
8 *

--- 38 unchanged lines hidden (view full) ---

47#include <sys/ioctl.h>
48#include <sys/mtio.h>
49#include <sys/stat.h>
50#include <sys/wait.h>
51#include <err.h>
52#include <errno.h>
53#include <fcntl.h>
54#include <signal.h>
1/*-
2 * Copyright (c) 1992 Keith Muller.
3 * Copyright (c) 1992, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Keith Muller of the University of California, San Diego.
8 *

--- 38 unchanged lines hidden (view full) ---

47#include <sys/ioctl.h>
48#include <sys/mtio.h>
49#include <sys/stat.h>
50#include <sys/wait.h>
51#include <err.h>
52#include <errno.h>
53#include <fcntl.h>
54#include <signal.h>
55#include <stdint.h>
55#include <stdio.h>
56#include <string.h>
57#include <stdlib.h>
58#include <unistd.h>
59#include "pax.h"
60#include "options.h"
61#include "extern.h"
62

--- 316 unchanged lines hidden (view full) ---

379 /*
380 * If we have not determined the format yet, we just say how many bytes
381 * we have skipped over looking for a header to id. there is no way we
382 * could have written anything yet.
383 */
384 if (frmt == NULL) {
385# ifdef NET2_STAT
386 (void)fprintf(listf, "%s: unknown format, %lu bytes skipped.\n",
56#include <stdio.h>
57#include <string.h>
58#include <stdlib.h>
59#include <unistd.h>
60#include "pax.h"
61#include "options.h"
62#include "extern.h"
63

--- 316 unchanged lines hidden (view full) ---

380 /*
381 * If we have not determined the format yet, we just say how many bytes
382 * we have skipped over looking for a header to id. there is no way we
383 * could have written anything yet.
384 */
385 if (frmt == NULL) {
386# ifdef NET2_STAT
387 (void)fprintf(listf, "%s: unknown format, %lu bytes skipped.\n",
388 argv0, rdcnt);
387# else
389# else
388 (void)fprintf(listf, "%s: unknown format, %qu bytes skipped.\n",
390 (void)fprintf(listf, "%s: unknown format, %ju bytes skipped.\n",
391 argv0, (uintmax_t)rdcnt);
389# endif
392# endif
390 argv0, rdcnt);
391 (void)fflush(listf);
392 flcnt = 0;
393 return;
394 }
395
396 if (strcmp(NM_CPIO, argv0) == 0)
393 (void)fflush(listf);
394 flcnt = 0;
395 return;
396 }
397
398 if (strcmp(NM_CPIO, argv0) == 0)
397 (void)fprintf(listf, "%qu blocks\n", (rdcnt ? rdcnt : wrcnt) / 5120);
399 (void)fprintf(listf, "%llu blocks\n",
400 (unsigned long long)((rdcnt ? rdcnt : wrcnt) / 5120));
398 else if (strcmp(NM_TAR, argv0) != 0)
399 (void)fprintf(listf,
400# ifdef NET2_STAT
401 "%s: %s vol %d, %lu files, %lu bytes read, %lu bytes written.\n",
401 else if (strcmp(NM_TAR, argv0) != 0)
402 (void)fprintf(listf,
403# ifdef NET2_STAT
404 "%s: %s vol %d, %lu files, %lu bytes read, %lu bytes written.\n",
405 argv0, frmt->name, arvol-1, flcnt, rdcnt, wrcnt);
402# else
406# else
403 "%s: %s vol %d, %lu files, %qu bytes read, %qu bytes written.\n",
407 "%s: %s vol %d, %ju files, %ju bytes read, %ju bytes written.\n",
408 argv0, frmt->name, arvol-1, (uintmax_t)flcnt,
409 (uintmax_t)rdcnt, (uintmax_t)wrcnt);
404# endif
410# endif
405 argv0, frmt->name, arvol-1, flcnt, rdcnt, wrcnt);
406 (void)fflush(listf);
407 flcnt = 0;
408}
409
410/*
411 * ar_drain()
412 * drain any archive format independent padding from an archive read
413 * from a socket or a pipe. This is to prevent the process on the

--- 872 unchanged lines hidden ---
411 (void)fflush(listf);
412 flcnt = 0;
413}
414
415/*
416 * ar_drain()
417 * drain any archive format independent padding from an archive read
418 * from a socket or a pipe. This is to prevent the process on the

--- 872 unchanged lines hidden ---