iostat.c (sysstat-12.4.0.tar.xz) | : | iostat.c (sysstat-12.4.1.tar.xz) | ||
---|---|---|---|---|
skipping to change at line 1941 | skipping to change at line 1941 | |||
memset(&alrm_act, 0, sizeof(alrm_act)); | memset(&alrm_act, 0, sizeof(alrm_act)); | |||
alrm_act.sa_handler = alarm_handler; | alrm_act.sa_handler = alarm_handler; | |||
sigaction(SIGALRM, &alrm_act, NULL); | sigaction(SIGALRM, &alrm_act, NULL); | |||
alarm(interval); | alarm(interval); | |||
/* Set a handler for SIGINT */ | /* Set a handler for SIGINT */ | |||
memset(&int_act, 0, sizeof(int_act)); | memset(&int_act, 0, sizeof(int_act)); | |||
int_act.sa_handler = int_handler; | int_act.sa_handler = int_handler; | |||
sigaction(SIGINT, &int_act, NULL); | sigaction(SIGINT, &int_act, NULL); | |||
/* Don't buffer data if redirected to a pipe */ | ||||
setbuf(stdout, NULL); | ||||
do { | do { | |||
/* Every device is potentially nonexistent */ | /* Every device is potentially nonexistent */ | |||
set_devices_nonexistent(dev_list); | set_devices_nonexistent(dev_list); | |||
/* Read system uptime */ | /* Read system uptime */ | |||
read_uptime(&(uptime_cs[curr])); | read_uptime(&(uptime_cs[curr])); | |||
/* Read stats for CPU "all" */ | /* Read stats for CPU "all" */ | |||
read_stat_cpu(st_cpu[curr], 1); | read_stat_cpu(st_cpu[curr], 1); | |||
skipping to change at line 2335 | skipping to change at line 2332 | |||
} | } | |||
/* Allocate and init stat common counters */ | /* Allocate and init stat common counters */ | |||
init_stats(); | init_stats(); | |||
/* How many processors on this machine? */ | /* How many processors on this machine? */ | |||
cpu_nr = get_cpu_nr(~0, FALSE); | cpu_nr = get_cpu_nr(~0, FALSE); | |||
get_localtime(&rectime, 0); | get_localtime(&rectime, 0); | |||
/* | ||||
* Don't buffer data if redirected to a pipe. | ||||
* Note: With musl-c, the behavior of this function is undefined except | ||||
* when it is the first operation on the stream. | ||||
*/ | ||||
setbuf(stdout, NULL); | ||||
/* Get system name, release number and hostname */ | /* Get system name, release number and hostname */ | |||
__uname(&header); | __uname(&header); | |||
if (print_gal_header(&rectime, header.sysname, header.release, | if (print_gal_header(&rectime, header.sysname, header.release, | |||
header.nodename, header.machine, cpu_nr, | header.nodename, header.machine, cpu_nr, | |||
DISPLAY_JSON_OUTPUT(flags))) { | DISPLAY_JSON_OUTPUT(flags))) { | |||
flags |= I_D_ISO; | flags |= I_D_ISO; | |||
} | } | |||
if (!DISPLAY_JSON_OUTPUT(flags)) { | if (!DISPLAY_JSON_OUTPUT(flags)) { | |||
printf("\n"); | printf("\n"); | |||
} | } | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 7 lines changed or added |