Permalink
Browse files

untabify

Change-Id: I7689524f682ed0ad164f28a28e7db3e87b54ba91
  • Loading branch information...
1 parent 2ffcf7a commit 1aa8cd9f10a0dcb83a36895e06744e0b1b2311aa Aliaksey Kandratsenka committed May 3, 2011
Showing with 45 additions and 45 deletions.
  1. +45 −45 sigar_port.c
View
@@ -25,71 +25,71 @@
#endif
struct system_stats {
- uint32_t version;
- uint32_t struct_size;
+ uint32_t version;
+ uint32_t struct_size;
- uint64_t cpu_total_ms;
- uint64_t cpu_idle_ms;
+ uint64_t cpu_total_ms;
+ uint64_t cpu_idle_ms;
- uint64_t swap_total;
- uint64_t swap_used;
- uint64_t swap_page_in;
- uint64_t swap_page_out;
+ uint64_t swap_total;
+ uint64_t swap_used;
+ uint64_t swap_page_in;
+ uint64_t swap_page_out;
- uint64_t mem_total;
- uint64_t mem_used;
- uint64_t mem_actual_used;
- uint64_t mem_actual_free;
+ uint64_t mem_total;
+ uint64_t mem_used;
+ uint64_t mem_actual_used;
+ uint64_t mem_actual_free;
};
int main(void)
{
- sigar_t *sigar;
- sigar_mem_t mem;
- sigar_swap_t swap;
- sigar_cpu_t cpu;
- struct system_stats reply;
+ sigar_t *sigar;
+ sigar_mem_t mem;
+ sigar_swap_t swap;
+ sigar_cpu_t cpu;
+ struct system_stats reply;
- sigar_open(&sigar);
+ sigar_open(&sigar);
#ifdef _WIN32
_setmode(1, _O_BINARY);
_setmode(0, _O_BINARY);
#endif
- while (!feof(stdin)) {
- int req;
- int rv = fread(&req, sizeof(req), 1, stdin);
- if (rv < 1) {
- continue;
+ while (!feof(stdin)) {
+ int req;
+ int rv = fread(&req, sizeof(req), 1, stdin);
+ if (rv < 1) {
+ continue;
}
- if (req != 0) {
- break;
+ if (req != 0) {
+ break;
}
- memset(&reply, 0, sizeof(reply));
- reply.version = 0;
- reply.struct_size = sizeof(reply);
+ memset(&reply, 0, sizeof(reply));
+ reply.version = 0;
+ reply.struct_size = sizeof(reply);
- sigar_mem_get(sigar, &mem);
- sigar_swap_get(sigar, &swap);
- sigar_cpu_get(sigar, &cpu);
+ sigar_mem_get(sigar, &mem);
+ sigar_swap_get(sigar, &swap);
+ sigar_cpu_get(sigar, &cpu);
- reply.cpu_total_ms = cpu.total;
- reply.cpu_idle_ms = cpu.idle;
+ reply.cpu_total_ms = cpu.total;
+ reply.cpu_idle_ms = cpu.idle;
- reply.swap_total = swap.total;
- reply.swap_used = swap.used;
- reply.swap_page_in = swap.page_in;
- reply.swap_page_out = swap.page_out;
+ reply.swap_total = swap.total;
+ reply.swap_used = swap.used;
+ reply.swap_page_in = swap.page_in;
+ reply.swap_page_out = swap.page_out;
- reply.mem_total = mem.total;
- reply.mem_used = mem.used;
- reply.mem_actual_used = mem.actual_used;
- reply.mem_actual_free = mem.actual_free;
+ reply.mem_total = mem.total;
+ reply.mem_used = mem.used;
+ reply.mem_actual_used = mem.actual_used;
+ reply.mem_actual_free = mem.actual_free;
- fwrite(&reply, sizeof(reply), 1, stdout);
- fflush(stdout);
- }
+ fwrite(&reply, sizeof(reply), 1, stdout);
+ fflush(stdout);
+ }
- return 0;
+ return 0;
}

0 comments on commit 1aa8cd9

Please sign in to comment.