position.c (127958) | position.c (250469) |
---|---|
1/*- 2 * Copyright (c) 1991, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Keith Muller of the University of California, San Diego and Lance 7 * Visser of Convex Computer Corporation. 8 * --- 23 unchanged lines hidden (view full) --- 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)position.c 8.3 (Berkeley) 4/2/94"; 37#endif 38#endif /* not lint */ 39#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1991, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Keith Muller of the University of California, San Diego and Lance 7 * Visser of Convex Computer Corporation. 8 * --- 23 unchanged lines hidden (view full) --- 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)position.c 8.3 (Berkeley) 4/2/94"; 37#endif 38#endif /* not lint */ 39#include <sys/cdefs.h> |
40__FBSDID("$FreeBSD: head/bin/dd/position.c 127958 2004-04-06 20:06:54Z markm $"); | 40__FBSDID("$FreeBSD: head/bin/dd/position.c 250469 2013-05-10 18:43:36Z eadler $"); |
41 42#include <sys/types.h> 43#include <sys/mtio.h> 44 45#include <err.h> 46#include <errno.h> 47#include <inttypes.h> | 41 42#include <sys/types.h> 43#include <sys/mtio.h> 44 45#include <err.h> 46#include <errno.h> 47#include <inttypes.h> |
48#include <signal.h> |
|
48#include <unistd.h> 49 50#include "dd.h" 51#include "extern.h" 52 53/* 54 * Position input/output data streams before starting the copy. Device type 55 * dependent. Seekable devices use lseek, and the rest position by reading. --- 30 unchanged lines hidden (view full) --- 86 if ((nr = read(in.fd, in.db, bcnt)) > 0) { 87 if (in.flags & ISPIPE) { 88 if (!(bcnt -= nr)) { 89 bcnt = in.dbsz; 90 --cnt; 91 } 92 } else 93 --cnt; | 49#include <unistd.h> 50 51#include "dd.h" 52#include "extern.h" 53 54/* 55 * Position input/output data streams before starting the copy. Device type 56 * dependent. Seekable devices use lseek, and the rest position by reading. --- 30 unchanged lines hidden (view full) --- 87 if ((nr = read(in.fd, in.db, bcnt)) > 0) { 88 if (in.flags & ISPIPE) { 89 if (!(bcnt -= nr)) { 90 bcnt = in.dbsz; 91 --cnt; 92 } 93 } else 94 --cnt; |
95 if (need_summary) 96 summary(); |
|
94 continue; 95 } 96 97 if (nr == 0) { 98 if (files_cnt > 1) { 99 --files_cnt; 100 continue; 101 } --- 82 unchanged lines hidden --- | 97 continue; 98 } 99 100 if (nr == 0) { 101 if (files_cnt > 1) { 102 --files_cnt; 103 continue; 104 } --- 82 unchanged lines hidden --- |