fprintf(stderr,
"WARNING: Server doesn't support retrieval of Rx statistics\n");
} else {
- union {
- struct rx_statistics rxstats;
- struct rx_debugIn debug;
- } packet;
+ struct rx_statistics rxstats;
/* should gracefully handle the case where rx_stats grows */
code =
- rx_GetServerStats(s, host, port, &packet.rxstats,
+ rx_GetServerStats(s, host, port, &rxstats,
&supportedStatValues);
if (code < 0) {
printf("rxstats call failed with code %d\n", code);
exit(1);
}
- if (code != sizeof(packet.rxstats)) {
- if (packet.debug.type == RX_DEBUGI_BADTYPE)
+ if (code != sizeof(rxstats)) {
+ struct rx_debugIn debug;
+ memcpy(&debug, &rxstats, sizeof(debug));
+ if (debug.type == RX_DEBUGI_BADTYPE)
goto noRxStats;
printf
("WARNING: returned Rx statistics of unexpected size (got %d)\n",
/* handle other versions?... */
}
- rx_PrintTheseStats(stdout, &packet.rxstats, sizeof(packet.rxstats),
+ rx_PrintTheseStats(stdout, &rxstats, sizeof(rxstats),
tstats.nFreePackets, tstats.version);
}
}
afs_int32 got_no_time = 0, code;
if (!uuid_init_done) {
- union {
- uuid_time_t t;
- u_short seed[4];
- } uuid_time;
- u_short seed = 0;
+ uuid_time_t t;
+ u_short seedp[4], seed = 0;
rand_m = 971;;
rand_ia = 11113;
rand_ib = 104322;
* independent. Then for good measure to ensure a unique seed when there
* are multiple processes creating UUID's on a system, we add in the PID.
*/
- uuid__get_os_time(&uuid_time.t);
- seed ^= uuid_time.seed[0];
- seed ^= uuid_time.seed[1];
- seed ^= uuid_time.seed[2];
- seed ^= uuid_time.seed[3];
+ uuid__get_os_time(&t);
+ memcpy(&seedp, &t, sizeof(seedp));
+ seed ^= seedp[0];
+ seed ^= seedp[1];
+ seed ^= seedp[2];
+ seed ^= seedp[3];
#if defined(KERNEL) && defined(AFS_XBSD_ENV)
rand_irand += seed + (afs_uint32) curproc->p_pid;
#elif defined(UKERNEL)