Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 161045 Details for
Bug 212076
Allow longer hostnames with rwhod / ruptime
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Proposed patch
netkit-rwho-0.17-hostnamelen.patch (text/plain), 2.10 KB, created by
Jiri Moskovcak
on 2007-08-10 11:48:37 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Jiri Moskovcak
Created:
2007-08-10 11:48:37 UTC
Size:
2.10 KB
patch
obsolete
>Only in netkit-rwho-0.17mzk/: MCONFIG >Only in netkit-rwho-0.17mzk/ruptime: a.out >diff -urp netkit-rwho-0.17/ruptime/ruptime.c netkit-rwho-0.17mzk/ruptime/ruptime.c >--- netkit-rwho-0.17/ruptime/ruptime.c 2007-08-10 13:29:10.000000000 +0200 >+++ netkit-rwho-0.17mzk/ruptime/ruptime.c 2007-08-10 13:46:08.000000000 +0200 >@@ -66,6 +66,7 @@ struct hs { > > #define ISDOWN(h) (now - (h)->hs_recvtime > 11 * 60) > #define WHDRSIZE ((int)(sizeof (awhod) - sizeof (awhod.wd_we))) >+#define HOSTNAMELEN 12 > > static size_t nhosts, hspace = 20; > static struct hs *hs; >@@ -93,10 +94,11 @@ main(int argc, char **argv) > unsigned i; > struct whod buf; > int (*cmp)(const void *, const void *) = hscmp; >+ int hostnamelen = HOSTNAMELEN; > time_t correction; > > aflg = 0; >- while ((ch = getopt(argc, argv, "alrut")) != -1) >+ while ((ch = getopt(argc, argv, "alrutn:")) != -1) > switch((char)ch) { > case 'a': > aflg = 1; >@@ -113,6 +115,13 @@ main(int argc, char **argv) > case 'u': > cmp = ucmp; > break; >+ case 'n': >+ hostnamelen = atoi(optarg+1); >+ if(hostnamelen < 0){ >+ fprintf(stderr,"Error, hostname length can't be negative number!\n"); >+ exit(1); >+ } >+ break; > default: > (void)fprintf(stderr, "usage: ruptime [-alrut]\n"); > exit(1); >@@ -182,15 +191,20 @@ main(int argc, char **argv) > } > (void)time(&now); > qsort(hs, nhosts, sizeof(hs[0]), cmp); >+ char output_format[512]; >+ char *down_pattern = "%%-%i.%is%%s\n"; >+ char *up_pattern = "%%-%i.%is%%s, %%4d user%%s load %%*.2f, %%*.2f, %%*.2f\n"; > for (i = 0; i < nhosts; i++) { > hsp = &hs[i]; > if (ISDOWN(hsp)) { >- (void)printf("%-12.12s%s\n", hsp->hs_hostname, >+ sprintf(output_format, down_pattern, hostnamelen,hostnamelen); >+ (void)printf(output_format, hsp->hs_hostname, > interval(now - hsp->hs_recvtime, "down")); > continue; > } >+ sprintf(output_format, up_pattern, hostnamelen,hostnamelen); > (void)printf( >- "%-12.12s%s, %4d user%s load %*.2f, %*.2f, %*.2f\n", >+ output_format, > hsp->hs_hostname, > interval((time_t)hsp->hs_sendtime - > (time_t)hsp->hs_boottime, " up"), >Only in netkit-rwho-0.17mzk/ruptime: ruptime.c~
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 212076
:
161045
|
541982