Deleted Added
full compact
optr.c (161017) optr.c (161025)
1/*-
2 * Copyright (c) 1980, 1988, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

27 * SUCH DAMAGE.
28 */
29
30#ifndef lint
31#if 0
32static char sccsid[] = "@(#)optr.c 8.2 (Berkeley) 1/6/94";
33#endif
34static const char rcsid[] =
1/*-
2 * Copyright (c) 1980, 1988, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

27 * SUCH DAMAGE.
28 */
29
30#ifndef lint
31#if 0
32static char sccsid[] = "@(#)optr.c 8.2 (Berkeley) 1/6/94";
33#endif
34static const char rcsid[] =
35 "$FreeBSD: head/sbin/dump/optr.c 161017 2006-08-06 08:37:46Z marck $";
35 "$FreeBSD: head/sbin/dump/optr.c 161025 2006-08-06 14:23:50Z marck $";
36#endif /* not lint */
37
38#include <sys/param.h>
39#include <sys/queue.h>
40#include <sys/wait.h>
41#include <sys/time.h>
42
43#include <ufs/ufs/dinode.h>

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

204 deltat = (blockswritten == 0) ? 0 : tstart_writing - tnow +
205 (double)(tnow - tstart_writing) / blockswritten * tapesize;
206 tdone = tnow + deltat;
207 percent = (blockswritten * 100.0) / tapesize;
208 hours = deltat / 3600;
209 mins = (deltat % 3600) / 60;
210
211 tdone_str = ctime(&tdone);
36#endif /* not lint */
37
38#include <sys/param.h>
39#include <sys/queue.h>
40#include <sys/wait.h>
41#include <sys/time.h>
42
43#include <ufs/ufs/dinode.h>

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

204 deltat = (blockswritten == 0) ? 0 : tstart_writing - tnow +
205 (double)(tnow - tstart_writing) / blockswritten * tapesize;
206 tdone = tnow + deltat;
207 percent = (blockswritten * 100.0) / tapesize;
208 hours = deltat / 3600;
209 mins = (deltat % 3600) / 60;
210
211 tdone_str = ctime(&tdone);
212 tdone_str[(strlen(tdone_str) - 1)] = '\0';
212 tdone_str[strlen(tdone_str) - 1] = '\0';
213 setproctitle(
214 "%s: pass %d: %3.2f%% done, finished in %d:%02d at %s",
215 disk, passno, percent, hours, mins, tdone_str);
216 if (tnow >= tschedule) {
217 tschedule = tnow + 300;
218 if (blockswritten < 500)
219 return;
220 msg("%3.2f%% done, finished in %d:%02d at %s\n", percent,

--- 208 unchanged lines hidden ---
213 setproctitle(
214 "%s: pass %d: %3.2f%% done, finished in %d:%02d at %s",
215 disk, passno, percent, hours, mins, tdone_str);
216 if (tnow >= tschedule) {
217 tschedule = tnow + 300;
218 if (blockswritten < 500)
219 return;
220 msg("%3.2f%% done, finished in %d:%02d at %s\n", percent,

--- 208 unchanged lines hidden ---