FreeBSD Bugzilla – Attachment 7889 Details for
Bug 16838
MFC/PATCH: phk's print uptime at reboot
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.09 KB, created by
jack
on 2000-02-20 20:10:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
jack
Created:
2000-02-20 20:10:01 UTC
Size:
1.09 KB
patch
obsolete
>--- kern_shutdown.c.orig Sun Aug 29 12:26:02 1999 >+++ kern_shutdown.c Sun Feb 20 14:39:53 2000 >@@ -125,6 +125,7 @@ > > static void boot __P((int)) __dead2; > static void dumpsys __P((void)); >+static void print_uptime __P((void)); > > #ifndef _SYS_SYSPROTO_H_ > struct reboot_args { >@@ -168,6 +169,33 @@ > static int waittime = -1; > static struct pcb dumppcb; > >+static void >+print_uptime() >+{ >+ int f; >+ struct timespec ts; >+ >+ getnanouptime(&ts); >+ printf("Uptime: "); >+ f = 0; >+ if (ts.tv_sec >= 86400) { >+ printf("%ldd", ts.tv_sec / 86400); >+ ts.tv_sec %= 86400; >+ f = 1; >+ } >+ if (f || ts.tv_sec >= 3600) { >+ printf("%ldh", ts.tv_sec / 3600); >+ ts.tv_sec %= 3600; >+ f = 1; >+ } >+ if (f || ts.tv_sec >= 60) { >+ printf("%ldm", ts.tv_sec / 60); >+ ts.tv_sec %= 60; >+ f = 1; >+ } >+ printf("%lds\n", ts.tv_sec); >+} >+ > /* > * Go through the rigmarole of shutting down.. > * this used to be in machdep.c but I'll be dammned if I could see >@@ -271,6 +299,8 @@ > } > DELAY(100000); /* wait for console output to finish */ > } >+ >+ print_uptime(); > > /* > * Ok, now do things that assume all filesystem activity has
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 16838
: 7889