README 600 15364 311 1043 5524133436 5050 This is a small patch for ruptime, that makes it give correct results. The problem was that rwhod was using one type of byte order, and ruptime another. The solution was to rearange the bytes using the ntohl function. Simple enough, and ruptime now works. -- ______ _______ | __ \ | _____| devmorfo@cs.mtu.edu (Evmorfopoulos Dimitris) | | \ | | |___ | | | | | ___| Masters student working hard on | |___| | | |_____ |_______| * |_______| * "Sliding Sunday, Week compression algorithm." ruptime.diff 600 15364 311 3323 5524132547 6514 *** ../ruptime.old/ruptime.c Sat May 11 19:46:15 1991 --- ruptime.c Thu Feb 3 03:19:19 1994 *************** *** 110,117 **** bcopy(wd, hsp->hs_wd, WHDRSIZE); hsp->hs_nusers = 0; for (i = 0; i < 2; i++) ! if (wd->wd_loadav[i] > maxloadav) ! maxloadav = wd->wd_loadav[i]; we = (struct whoent *)(buf+cc); while (--we >= wd->wd_we) if (aflg || we->we_idle < 3600) --- 110,117 ---- bcopy(wd, hsp->hs_wd, WHDRSIZE); hsp->hs_nusers = 0; for (i = 0; i < 2; i++) ! if (ntohl(wd->wd_loadav[i]) > maxloadav) ! maxloadav = ntohl(wd->wd_loadav[i]); we = (struct whoent *)(buf+cc); while (--we >= wd->wd_we) if (aflg || we->we_idle < 3600) *************** *** 134,143 **** interval(now - hsp->hs_wd->wd_recvtime, "down")); continue; } printf("%-12.12s%s, %4d user%s load %*.2f, %*.2f, %*.2f\n", hsp->hs_wd->wd_hostname, ! interval(hsp->hs_wd->wd_sendtime - ! hsp->hs_wd->wd_boottime, " up"), hsp->hs_nusers, hsp->hs_nusers == 1 ? ", " : "s,", maxloadav >= 1000 ? 5 : 4, --- 134,146 ---- interval(now - hsp->hs_wd->wd_recvtime, "down")); continue; } + hsp->hs_wd->wd_loadav[0] = ntohl(hsp->hs_wd->wd_loadav[0]); + hsp->hs_wd->wd_loadav[1] = ntohl(hsp->hs_wd->wd_loadav[1]); + hsp->hs_wd->wd_loadav[2] = ntohl(hsp->hs_wd->wd_loadav[2]); printf("%-12.12s%s, %4d user%s load %*.2f, %*.2f, %*.2f\n", hsp->hs_wd->wd_hostname, ! interval(ntohl(hsp->hs_wd->wd_sendtime) - ! ntohl(hsp->hs_wd->wd_boottime), " up"), hsp->hs_nusers, hsp->hs_nusers == 1 ? ", " : "s,", maxloadav >= 1000 ? 5 : 4,