}
sep = TRUE;
- xprintf0(tab, "{\"filesystem\": \"%s\", "
- if(DISPLAY_MOUNT(a->opt_flags)) {
- xprintf0(tab, "{\"mountpoint\": \"%s\", "
- "\"MBfsfree\": %.0f, "
- "\"MBfsused\": %.0f, "
- "\"%%fsused\": %.2f, "
- "\"%%ufsused\": %.2f, "
- "\"Ifree\": %llu, "
- "\"Iused\": %llu, "
- "\"%%Iused\": %.2f}",
- sfc->mountp,
- (double) sfc->f_bfree / 1024 / 1024,
- (double) (sfc->f_blocks - sfc->f_bfree) / 1024 / 1024,
- sfc->f_blocks ? SP_VALUE(sfc->f_bfree, sfc->f_blocks, sfc->f_blocks)
- : 0.0,
- sfc->f_blocks ? SP_VALUE(sfc->f_bavail, sfc->f_blocks, sfc->f_blocks)
- : 0.0,
- sfc->f_ffree,
- sfc->f_files - sfc->f_ffree,
- sfc->f_files ? SP_VALUE(sfc->f_ffree, sfc->f_files, sfc->f_files)
- : 0.0);
- } else {
- xprintf0(tab, "{\"filesystem\": \"%s\", "
- "\"MBfsfree\": %.0f, "
- "\"MBfsused\": %.0f, "
- "\"%%fsused\": %.2f, "
- "\"%%ufsused\": %.2f, "
- "\"Ifree\": %llu, "
- "\"Iused\": %llu, "
- "\"%%Iused\": %.2f}",
- sfc->fs_name,
- (double) sfc->f_bfree / 1024 / 1024,
- (double) (sfc->f_blocks - sfc->f_bfree) / 1024 / 1024,
- sfc->f_blocks ? SP_VALUE(sfc->f_bfree, sfc->f_blocks, sfc->f_blocks)
- : 0.0,
- sfc->f_blocks ? SP_VALUE(sfc->f_bavail, sfc->f_blocks, sfc->f_blocks)
- : 0.0,
- sfc->f_ffree,
- sfc->f_files - sfc->f_ffree,
- sfc->f_files ? SP_VALUE(sfc->f_ffree, sfc->f_files, sfc->f_files)
- : 0.0);
-
- }
++ xprintf0(tab, "{\"%s\": \"%s\", "
+ "\"MBfsfree\": %.0f, "
+ "\"MBfsused\": %.0f, "
+ "\"%%fsused\": %.2f, "
+ "\"%%ufsused\": %.2f, "
+ "\"Ifree\": %llu, "
+ "\"Iused\": %llu, "
+ "\"%%Iused\": %.2f}",
- sfc->fs_name,
++ DISPLAY_MOUNT(a->opt_flags) ? "mountpoint" : "filesystem",
++ DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name,
+ (double) sfc->f_bfree / 1024 / 1024,
+ (double) (sfc->f_blocks - sfc->f_bfree) / 1024 / 1024,
+ sfc->f_blocks ? SP_VALUE(sfc->f_bfree, sfc->f_blocks, sfc->f_blocks)
+ : 0.0,
+ sfc->f_blocks ? SP_VALUE(sfc->f_bavail, sfc->f_blocks, sfc->f_blocks)
+ : 0.0,
+ sfc->f_ffree,
+ sfc->f_files - sfc->f_ffree,
+ sfc->f_files ? SP_VALUE(sfc->f_ffree, sfc->f_files, sfc->f_files)
+ : 0.0);
}
printf("\n");