dd.c (249811) | dd.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 * --- 29 unchanged lines hidden (view full) --- 38 The Regents of the University of California. All rights reserved.\n"; 39#endif /* not lint */ 40 41#ifndef lint 42static char sccsid[] = "@(#)dd.c 8.5 (Berkeley) 4/2/94"; 43#endif /* not lint */ 44#endif 45#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 * --- 29 unchanged lines hidden (view full) --- 38 The Regents of the University of California. All rights reserved.\n"; 39#endif /* not lint */ 40 41#ifndef lint 42static char sccsid[] = "@(#)dd.c 8.5 (Berkeley) 4/2/94"; 43#endif /* not lint */ 44#endif 45#include <sys/cdefs.h> |
46__FBSDID("$FreeBSD: head/bin/dd/dd.c 249811 2013-04-23 16:08:24Z kib $"); | 46__FBSDID("$FreeBSD: head/bin/dd/dd.c 250469 2013-05-10 18:43:36Z eadler $"); |
47 48#include <sys/param.h> 49#include <sys/stat.h> 50#include <sys/conf.h> 51#include <sys/disklabel.h> 52#include <sys/filio.h> 53#include <sys/time.h> 54 --- 21 unchanged lines hidden (view full) --- 76void (*cfunc)(void); /* conversion function */ 77uintmax_t cpy_cnt; /* # of blocks to copy */ 78static off_t pending = 0; /* pending seek if sparse */ 79u_int ddflags = 0; /* conversion options */ 80size_t cbsz; /* conversion block size */ 81uintmax_t files_cnt = 1; /* # of files to copy */ 82const u_char *ctab; /* conversion table */ 83char fill_char; /* Character to fill with if defined */ | 47 48#include <sys/param.h> 49#include <sys/stat.h> 50#include <sys/conf.h> 51#include <sys/disklabel.h> 52#include <sys/filio.h> 53#include <sys/time.h> 54 --- 21 unchanged lines hidden (view full) --- 76void (*cfunc)(void); /* conversion function */ 77uintmax_t cpy_cnt; /* # of blocks to copy */ 78static off_t pending = 0; /* pending seek if sparse */ 79u_int ddflags = 0; /* conversion options */ 80size_t cbsz; /* conversion block size */ 81uintmax_t files_cnt = 1; /* # of files to copy */ 82const u_char *ctab; /* conversion table */ 83char fill_char; /* Character to fill with if defined */ |
84volatile sig_atomic_t need_summary; |
|
84 85int 86main(int argc __unused, char *argv[]) 87{ 88 (void)setlocale(LC_CTYPE, ""); 89 jcl(argv); 90 setup(); 91 | 85 86int 87main(int argc __unused, char *argv[]) 88{ 89 (void)setlocale(LC_CTYPE, ""); 90 jcl(argv); 91 setup(); 92 |
92 (void)signal(SIGINFO, summaryx); | 93 (void)signal(SIGINFO, siginfo_handler); |
93 (void)signal(SIGINT, terminate); 94 95 atexit(summary); 96 97 while (files_cnt--) 98 dd_in(); 99 100 dd_close(); --- 269 unchanged lines hidden (view full) --- 370 ++st.swab; 371 --n; 372 } 373 swab(in.dbp, in.dbp, (size_t)n); 374 } 375 376 in.dbp += in.dbrcnt; 377 (*cfunc)(); | 94 (void)signal(SIGINT, terminate); 95 96 atexit(summary); 97 98 while (files_cnt--) 99 dd_in(); 100 101 dd_close(); --- 269 unchanged lines hidden (view full) --- 371 ++st.swab; 372 --n; 373 } 374 swab(in.dbp, in.dbp, (size_t)n); 375 } 376 377 in.dbp += in.dbrcnt; 378 (*cfunc)(); |
379 if (need_summary) { 380 summary(); 381 } |
|
378 } 379} 380 381/* 382 * Clean up any remaining I/O and flush output. If necessary, the output file 383 * is truncated. 384 */ 385static void --- 116 unchanged lines hidden --- | 382 } 383} 384 385/* 386 * Clean up any remaining I/O and flush output. If necessary, the output file 387 * is truncated. 388 */ 389static void --- 116 unchanged lines hidden --- |